Skip to content

Commit

Permalink
bug fix on fbpost ye count
Browse files Browse the repository at this point in the history
  • Loading branch information
alemyis committed Mar 17, 2011
1 parent 5a554a5 commit a0180c9
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
8 changes: 7 additions & 1 deletion app/controllers/application_controller.rb
Expand Up @@ -16,7 +16,13 @@ def fbcanvas
if(params[:fbpost].nil?) then
redirect_to :controller => 'misales', :action => 'index'
else
redirect_to :controller => 'misales', :action => 'fbpost'
#redirect_to :controller => 'misales', :action => 'fbpost'
@misale = Misale.find(params[:fbpost])

@misale.ye = @misale.ye.nil? ? 1 : 1 + @misale.ye
@misale.save

render :partial => '/misales/unload'
end
end
end
6 changes: 2 additions & 4 deletions app/controllers/misales_controller.rb
Expand Up @@ -104,13 +104,11 @@ def destroy

def fbpost
@misale = Misale.find(params[:id])
#@misale.ye =
puts @misale.ye

@misale.ye = @misale.ye.nil? ? 1 : 1 + @misale.ye
@misale.save

puts @misale.ye
render 'fbpost'
render :partial => '/misales/unload'
end

def home
Expand Down
9 changes: 9 additions & 0 deletions app/views/misales/_unload.html.erb
@@ -0,0 +1,9 @@
<html>
<body>
<script type='text/javascript'>
window.onload = function() {
window.close();
};
</script>
</body>
</html>
5 changes: 0 additions & 5 deletions app/views/misales/fbpost.html.erb

This file was deleted.

1 change: 1 addition & 0 deletions public/javascripts/application.js
Expand Up @@ -112,6 +112,7 @@ $(document).ready(function() {
}
FB.Canvas.setSize({ height: frameSize() + 100 });
});

});

function frameSize(){
Expand Down

0 comments on commit a0180c9

Please sign in to comment.