Matt Carlson
2009-Mar-07 21:13 UTC
[Facebooker-talk] Help with link_to_remote method=>delete?
I''m struggling to get the following link_to_remote code working and am wondering if anyone can help me out? <span> <%= link_to_remote image_tag(''close.gif'', :class => ''delete''), :url => status_url(:id => status, :canvas=>false), :method => :delete %> </span> I don''t see any Firebug errors, but do get the following Rails server error: ActionController::MethodNotAllowed (Only get, put, and delete requests are allowed.) I also only see the Facebook POST hitting the ApplicationController and not making it to my StatusesController.... Cheers, Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20090307/66031310/attachment.html>
Mike Mangino
2009-Mar-09 13:06 UTC
[Facebooker-talk] Help with link_to_remote method=>delete?
It looks like the :method=>:delete isn''t making it. What parameters are you getting on the request? Mike On Mar 7, 2009, at 4:13 PM, Matt Carlson wrote:> I''m struggling to get the following link_to_remote code working and > am wondering if anyone can help me out? > > <span> > <%= link_to_remote image_tag(''close.gif'', :class => > ''delete''), > :url => status_url(:id => > status, :canvas=>false), > :method => :delete %> > </span> > > I don''t see any Firebug errors, but do get the following Rails > server error: > ActionController::MethodNotAllowed (Only get, put, and delete > requests are allowed.) > > I also only see the Facebook POST hitting the ApplicationController > and not making it to my StatusesController.... > > > Cheers, > Matt > > > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk-- Mike Mangino http://www.elevatedrails.com
Matt Carlson
2009-Mar-09 18:10 UTC
[Facebooker-talk] Help with link_to_remote method=>delete?
You''re correct, :method=>:delete wasn''t making it in the request: Parameters: {"fb_sig_app_id"=>"61934216788", "authenticity_token"=>"ff9ade6d48c507cf10ac0d640af485c9edd15234", "fb_sig_locale"=>"en_US", "fb_sig_in_new_facebook"=>"1", "fb_sig"=>"59fd5294a6e7b76009852dbb5f6c278b", "fb_sig_added"=>"1", "fb_sig_expires"=>"1236549600", "fb_sig_session_key"=>"2.whqq8PF7q1DD_Evihwi52g__.86400.1236549600-690279775", "fb_sig_is_ajax"=>"1", "fb_sig_api_key"=>"f2aaeb240414ac632c51c6aa5481f1a0", "fb_sig_time"=>"1236461548.8907", "fb_sig_profile_update_time"=>"1229643941", "fb_sig_user"=>"690279775"} However, by creating an explicit route: status.delete_status ''/destroy/:id'', :action => ''destroy'', :method => :delete I was able to see :method=>:delete come through in the request. On Mon, Mar 9, 2009 at 6:06 AM, Mike Mangino <mmangino at elevatedrails.com>wrote:> It looks like the :method=>:delete isn''t making it. What parameters are you > getting on the request? > > Mike > > On Mar 7, 2009, at 4:13 PM, Matt Carlson wrote: > > I''m struggling to get the following link_to_remote code working and am >> wondering if anyone can help me out? >> >> <span> >> <%= link_to_remote image_tag(''close.gif'', :class => ''delete''), >> :url => status_url(:id => status, :canvas=>false), >> :method => :delete %> >> </span> >> >> I don''t see any Firebug errors, but do get the following Rails server >> error: >> ActionController::MethodNotAllowed (Only get, put, and delete requests are >> allowed.) >> >> I also only see the Facebook POST hitting the ApplicationController and >> not making it to my StatusesController.... >> >> >> Cheers, >> Matt >> >> >> >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk >> > > -- > Mike Mangino > http://www.elevatedrails.com > > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20090309/2ae2af63/attachment.html>