For example typing: localhost:3000/absurd-non-existing-route
How do I get invalid routes to point to the main page of the application in Rails?
For example typing: localhost:3000/absurd-non-existing-route How do I get invalid routes to point to the
Share
Use rescue_from in your
ApplicationControllerto rescueActionController::RoutingErrorand redirect to the home page when it happens.This will not work in Rails 3 currently. A ticket has been filed.