tags:

views:

38

answers:

2

I am using TextMate on a Ruby on Rails project and wonder if you can put the mouse on link_to, and then press a key and it will show the definition of link_to, or does this for any other helper functions or Model definition?

Or, click open a box and type in a function name and it will show you the definition?

A: 

The CTags bundle worked really well for me when I was doing C++ in TextMate, and it should work for Ruby too (although I haven't tried it in a while).

RyanWilcox
A: 
  1. Make sure that you are in file with the language grammar set to either Ruby or RoR (verify by checking the "L" field in TM's status bar)

  2. Then highlight a function name whose definition you want (e.g., w/ your cursor just before the first letter of that function: shift-option-right arrow)

  3. Ctrl-H will usually bring up a menu of two options "Ruby: Documentation for Selection" and "RoR View Demo Help", which you can select by pressing "1" or "2"

  4. Pressing "1" will bring up the function's definition found in the Ruby Docs

doug