If I try to access some random string in the url of my rails application, for example /asdfasdifjasdfkj, then I see a rails error message
/asdfasdifjasdfkj
Routing error
No route matches "/asdfasdifjasdfkj" with {:method=>:get}
Even if I'm in production mode. Clearly, I do not want real users to see this, and would prefer a 404 page. Does anyone know what is going wrong and how can I fix it?
To get 404, you need to start the server in a production environment and use the external IP address, not the local / loopback ip address in the URL.
:
def local_request? return false end