Topic: Routing in Ruby On Rails

Suppose If a User Types a Invalid Url in The Browser .Consider My application Path is

But Instead of That if somebody types like this

What i want to do is Either i should redirect them to Index Page of my application or i should
show them 404 error pages saying That The File You Requested is not found,.I think This can be done using some settings in routes.rb file in config folder.But i dont know exactly how this can be done

Can anyone of u help me on this issue

Re: Routing in Ruby On Rails

You should always let the user know that the page they wanted was not found. If you redirect them to the index be sure to put a flash[:error] message somewhere that tells them you couldn't find what they wanted and redirected them.

These links both look pretty good: … 00-errors/

Re: Routing in Ruby On Rails

either you'd like to just show error, or redirect, response status should be 404.
displaying error page listing few links, like "Home", "Users" and "New user" would be just nice