Looking up Rails(3) routes
Looking up Rails3 routes
As everybody probably knows, you can use rake routes to look up info about existing routes and their helper methods. However, this takes a while to load and you need a huge screen to look at it. Today I thought of a much faster method for those of us having a rails console open all the time. Not that much of a deal, but it became a really helpful tool over the last week.
Just execute app.routes.sort. Even better if your Gemfile requires awesome_print, you can issue ap app.routes.sort. You could even filter the list using select or maybe even add methods to the app object to help with the filtering like in the example below which I use in my current project now. If you want to use it, just paste the code in a file like config/initializers/rinfo.rb, add awesome_print to your Gemfile and restart your console.