I get an error when trying to update a record when using a HTTP request PUT method from a form complying with the RESTful routing for the resource. The error is: Only get and post requests are allowed. Has anybody come accross this before? Hope somebody can help. Thanks in advance.
> > The error is: Only get and post requests are allowed. >This seems pretty straight forward... What does your routes.rb look like? For the model in question, does your like look something like: map.resources :mymodels, :member => {:myaction => :put} You''re trying to use a PUT, but have you told Rails to accept that for that action? -- Posted via http://www.ruby-forum.com/.
In my routes.rb I only have: map.resources :mymodel Am I correct in saying that the PUT method is set automatically in the RESTful routes while setting the resource?> Posted viahttp://www.ruby-forum.com/.
In my routes.rb I only have: map.resources :mymodel Am I correct in saying that the PUT method is set automatically in the RESTful routes while setting the resource?> Posted viahttp://www.ruby-forum.com/.
Lyn Williams wrote:> In my routes.rb I only have: > > map.resources :mymodel > > Am I correct in saying that the PUT method is set automatically in the > RESTful routes while setting the resource?http://api.rubyonrails.org/classes/ActionController/Resources.html -- Posted via http://www.ruby-forum.com/.
This route allows put requests on the update action which is routed to the url :controller/:id 2009/6/12, lyntaff <lyn-XFkl2lNNjp7BrJGnFWTVgQ@public.gmane.org>:> > In my routes.rb I only have: > > map.resources :mymodel > > Am I correct in saying that the PUT method is set automatically in the > RESTful routes while setting the resource? > > >> Posted viahttp://www.ruby-forum.com/. > > >-- Von meinen Mobilgerät aus gesendet