sc-kitten
2011-Jun-23 21:00 UTC
Ajax sends PUT for updates, Rails complains that it''s POST :(
Hi, I am not sure what is happening... But suddenly my apps in Rails started behaving weirdly. Non of the Ajax PUT requests are received as PUT anymore and instead Rails complains that I am sending POST... I also noticed that instead of the correct module, for example PUT request is sent via Ajax to /server/sections/3, and the error is thrown at the level of rails application. ActionController::MethodNotAllowed (Only get, put, and delete requests are allowed.) I would like to know what the heck is going on here and how to fix this... Any insightful ideas are welcome. Thanks so much, Elle -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Walter Lee Davis
2011-Jun-24 11:14 UTC
Re: Ajax sends PUT for updates, Rails complains that it''s POST :(
On Jun 23, 2011, at 5:00 PM, sc-kitten wrote:> Hi, > I am not sure what is happening... But suddenly my apps in Rails > started behaving weirdly. Non of the Ajax PUT requests are received as > PUT anymore and instead Rails complains that I am sending POST... I > also noticed that instead of the correct module, for example PUT > request is sent via Ajax to /server/sections/3, and the error is > thrown at the level of rails application. > > ActionController::MethodNotAllowed (Only get, put, and delete requests > are allowed.) > > I would like to know what the heck is going on here and how to fix > this... Any insightful ideas are welcome.Are you sure your JavaScript librar(y|ies) loaded correctly? Did you disable JavaScript in your browser during testing? Walter -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Gintautas Å imkus
2011-Jun-24 11:18 UTC
Re: Ajax sends PUT for updates, Rails complains that it''s POST :(
What is your JS code for sending the request? 2011/6/24 Walter Lee Davis <waltd-HQgmohHLjDZWk0Htik3J/w@public.gmane.org>> > On Jun 23, 2011, at 5:00 PM, sc-kitten wrote: > > Hi, >> I am not sure what is happening... But suddenly my apps in Rails >> started behaving weirdly. Non of the Ajax PUT requests are received as >> PUT anymore and instead Rails complains that I am sending POST... I >> also noticed that instead of the correct module, for example PUT >> request is sent via Ajax to /server/sections/3, and the error is >> thrown at the level of rails application. >> >> ActionController::**MethodNotAllowed (Only get, put, and delete requests >> are allowed.) >> >> I would like to know what the heck is going on here and how to fix >> this... Any insightful ideas are welcome. >> > > Are you sure your JavaScript librar(y|ies) loaded correctly? Did you > disable JavaScript in your browser during testing? > > Walter > > > > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk@googlegroups.**com<rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe@**googlegroups.com<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.