I've got a RESTful resource (let's say posts
) that excludes the index
action. When I go to /posts
, ActionController::MethodNotAllowed
is raised because GET
requests at that URL have been excluded. That much makes sense.
The problem is that in the production environment, that URL just generates a white screen in the browser. I can see ActionController::MethodNotAllowed
being raised in the production log. I would expect that this would also cause a 404
or 500
error so that the error pages in the public
directory would serve a pretty error page to the client.
Does this cause a different HTTP status code? How can I handle this?
I'm not positive about what the error might be, but you should get Firebug and check what the HTTP response code coming back is.
To get around the issue, you could do one of two things:
GET /posts
, which points to your desired controller.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.