In a rails application you can easily see what all the routes (or a dynamic way of linking to content in your web application) are available to you. To see what each of the routes available to you are you simply type
rake routes into the terminal. You’ll get something like this:
This is a very simplified example (a test app that I created to try out some ideas). As your application grows the number of routes will as well. As it grows it takes longer and longer for
rake routes to produce all the routes available.
Typically when you’re searching for routes you’re looking for a specific route or group of routes. Maybe, for instance, you are interested only in the user routes - logging in, logging out, signing up, etc. To find just that information you can use a search command “grep” like this:
rake routes | grep user and it will show you something like this:
But, what if you wanted everything but users?
rake routes | grep -v user
Or you can even get more specific and just view routes for a given controller.
rake routes CONTROLLER=posts