Skip to content

Instantly share code, notes, and snippets.

View aashish's full-sized avatar

Aashish Kiran aashish

  • India
View GitHub Profile
@viola
viola / http_method_not_allowed
Created September 26, 2011 22:19
Render 405 response for ActionController::UnknownHttpMethod exceptions
ActionController::UnknownHttpMethod exception found under rails 3.0.1
$ cat lib/http_method_not_allowed.rb
# Render 405 response for ActionController::UnknownHttpMethod exceptions like:
# (ActionController::UnknownHttpMethod) "CONNECT, accepted HTTP methods are get, head, put, post, delete, and options"
# (ActionController::UnknownHttpMethod) "PROPFIND, accepted HTTP methods are get, head, put, post, delete, and options"
class HttpMethodNotAllowed
def initialize(app)
@app = app