views:

122

answers:

1

if somebody type URL/frewfrefew, he gets a routing error. how do i get this invalids routes to point to the main page of the application in Rails. thnaks

+1  A: 

Use rescue_from in your ApplicationController to rescue ActionController::RoutingError and redirect to the home page when it happens.

This will not work in rails 3 currently. A ticket has been filed.

x1a4