"Only get, head, post, put, and delete requests are allowed. Ruby on Rails error"

Posted on 10 October 2008

Every so often I get the rather odd Ruby on Rails error "Only get, head, post, put, and delete requests are allowed."

So far, each time a simple restart of my local server has done the trick and made it go away.

About Paul

Paul works for Kyan web design agency in Surrey, UK as a Ruby on Rails developer.

Follow Paul on Twitter

Email: paulsturgess [at] gmail.com

Read more articles in the archive →

Comments...

  • I get the same thing when I change the routes file. Specifically, when the route for the resource I'm accessing has changed.

    Jonathan Towell at 10 Oct 08 at 17:13

  • Happens to me with models that use attachment_fu, that have a Word document attachment. Seems that Word attempts to make an OPTIONS request for more info on the file, probably something that SharePoint supports. No need to restart, but I do get the nice little exception_notification email...

    Will Green at 13 Oct 08 at 06:56

  • It's also good to check that all links to resources are correct. I ran into this issue in a form_for call to a nested resource. Turns out I was calling survey_question_path(@survey) instead of survey_questions_path(@survey). Little RESTful intricacies still seem to get me from time to time...

    Doug Johnston at 26 Aug 10 at 15:45

Got something to say?