2010-09-15
By Ivo Dancet
Tags:

Rails3

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.

blog comments powered by Disqus
About
This blog is written by Wouter Vancraeynest and Ivo Dancet and is about what we come across while working at our company by2.be, located in Bruges, Belgium. This can be anything related - though sometimes only remotely - to programming, testing, marketing, Ruby, Apple and other things we do and love ...
Recent posts
Optimizing Vim: tab style
haml-js and jammit
VimRoom
Hudson for a Rails3 project
Looking up Rails(3) routes
Horror story, part II
All tags
Jammit - SaaS - Rails - WriteRoom - Haml - rSpec - Vim - Ruby on Rails - rcov - Cucumber - humans - continuous integration - Hudson - Rails3 - testing - rSquery - haml-js - Bundler - rvm - backbone.js - Selenium
rSquery
Some time ago we made rSquery to be able to easily use jQuery matchers in Selenium projects. You may want to check it out on github. By now this project is not in active development anymore but older projects can still profit from it. (We still use it)