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?
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.
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With