Skip to content
A TextMate bundle with a couple of navigation functions for Rails' named routes: go to action, view etc.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


This is a TextMate bundle that provides a couple of functions for working with Ruby on Rails' named routes. The functions currently are:

  • go to named route action or view – Cmd-P

  • go to named route action – Ctrl-Cmd-P

  • go to named route view – Opt-Cmd-P

  • go to routes.rbCtrl-Opt-Cmd-R


If the selected text (or word under cursor) looks like a named route expression in your controller or view code, e.g:

post_comment_url(@post, @comment)

you can press Cmd-P to go to the action or view associated with this route (the choices are presented in a popup menu). You can also press Opt-Cmd-P to go directly to the view file or Ctrl-Cmd-P to go directly to the action.


mkdir -p ~/Library/Application\ Support/TextMate/Bundles
cd ~/Library/Application\ Support/TextMate/Bundles
git clone git://
osascript -e 'tell app "TextMate" to reload bundles'


Normally when you press any of the shortcuts, you should see a progress bar saying “Loading routes.rb” for a moment (exactly how long depends on your project and routes.rb size). If it says “Loading environment.rb” instead and stays considerably longer, there may be a problem with your routes.rb depending on something that is loaded by environment.rb file (in one of my projects it was a config class). So, if you want to speed up these operations, make sure that your routes.rb can be required without requireing environment.rb first (which takes notoriously long in most Rails projects).

To check this, run irb (NOT script/console) in your project directory and try issuing the following:

>> require 'config/boot.rb'
=> true
>> require 'action_controller'
=> true
>> require 'config/routes.rb'
=> []

If this goes without errors, you should be good to go. If you get some errors, there is something missing for routes.rb. You'll have to examine those errors and fix them if possible.


Tested with Rails 2.3.5. Should work with any Rails 2.x version (if it doesn't let me know). May not work with Rails 3 (I haven't tested it) but patches welcome.

To do

  • a command to go to route definition inside routes.rb

  • action names in menu for controller

  • separate menu sections for views, controller, route definitions

  • make it faster (somehow cache the routes?)

You can’t perform that action at this time.