Permalink
Browse files

changing to catch api problem

  • Loading branch information...
1 parent a36178d commit abf7d178ead9f14caf6ac9a7f99124ea91140675 @towski committed Jan 9, 2009
Showing with 5 additions and 2 deletions.
  1. +5 −1 app/controllers/status_controller.rb
  2. +0 −1 app/views/status/index.html.erb
@@ -11,9 +11,13 @@ def index
def create
user = session[:facebook_session].user
+ begin
+ user.set_status params[:status][:message]
+ rescue Facebooker::Session::ExtendedPermissionRequired => e
+ redirect_to "http://www.facebook.com/authorize.php?api_key=#{ENV['FACEBOOK_API_KEY']}&ext_perm=status_update&v=1.0"
+ end
@user = User.find user.id
@user.statuses.create! :message => params[:status][:message]
- user.set_status params[:status][:message]
redirect_to '/'
end
end
@@ -3,7 +3,6 @@
<%= image_tag @facebook_user.pic_square, :align => 'left' %>
<b><%= @facebook_user.name %></b>
<br/>
- <%= link_to "allow to update my status?", { :host => "www.facebook.com", :action => "authorize.php", :api_key => "95c28d60bb6f9ab45494cb75910f328b", :v => "1.0", :ext_perm => "status_update" }, :style => "font-size:11px" %>
</div>
<div style='float:right'>
<h1>What are you doing?</h1>

0 comments on commit abf7d17

Please sign in to comment.