Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Handling Unknown action in Rails 3

I'm new to Rails development and I have a question about handling an unknown action. What is the best way to handle that kind error?

like image 599
Ben Avatar asked Jun 23 '11 16:06

Ben


2 Answers

Do not handle it. If a user enters a wrong URL he will get a 404 error when you switch to production environment.

You get the exceptions only because you are in development environment.

like image 150
ayckoster Avatar answered Sep 22 '22 07:09

ayckoster


Show a 404 error, the user has entered a URL in which you don't have a corresponding Action within the Controller (or a route) defined to handle. It should be treated the same as if the user entered example.com/controller/jbsandfodsafoiuaudsfbsadf87basdfgsadfdsa.

like image 29
Michael Wales Avatar answered Sep 23 '22 07:09

Michael Wales