Next: , Previous: Optional Setup, Up: Top


3 Navigation

Rinari leverages the structure of Rails projects to allow immediate navigation between source files.

So for example if you are in a buffer open to foo_controller.rb, a call to rinari-find-model will open the foo.rb model file. Say you are currently inside the bar method in a buffer visiting foo_controller.rb, then calling rinari-find-test will take you to the test_bar method in test/functional/foo_controller_test.rb, or calling rinari-find-view will open app/views/foos/bar.rhtml.

All told there are currently 17 different rinari-find-* functions, which are all bound to similar hopefully intuitive keybindings allowing you to go anywhere from anywhere. To see the full range of rinari-find functions along with their bindings enter a rails project, activate rinari and call describe-bindings \H-b. The current list is also shown below.

     C-c ; f c	rinari-find-controller
     C-c ; f e	rinari-find-environment
     C-c ; f f	rinari-find-file-in-project
     C-c ; f h	rinari-find-helper
     C-c ; f i	rinari-find-migration
     C-c ; f j	rinari-find-javascript
     C-c ; f l	rinari-find-plugin
     C-c ; f m	rinari-find-model
     C-c ; f n	rinari-find-configuration
     C-c ; f o	rinari-find-log
     C-c ; f p	rinari-find-public
     C-c ; f s	rinari-find-script
     C-c ; f t	rinari-find-test
     C-c ; f v	rinari-find-view
     C-c ; f w	rinari-find-worker
     C-c ; f x	rinari-find-fixture
     C-c ; f y	rinari-find-stylesheet

TAGS (jumping to method definitions)

Emacs (as all grownup text editors should) makes use of tags (for a description of tags and their use see http://ctags.sourceforge.net/whatis.html). In Emacs the find-tag command is bound by default to M-.. It is often convenient to use a different set of TAGS for every rails project. Rinari facilitates this by automatically updating your tags-file-name variable whenever you enter a rails project, through the use of the rinari-tags-file-name variable. Just set rianri-tags-file to the path to your tags files relative to the root of the rails project. For example...

     (setq rinari-tags-file-name "TAGS")

to create such a tags file using exuberant ctags (http://ctags.sourceforge.net/) try executing something like the following from the root of your rails project.

     ctags-exuberant -a -e -f TAGS --tag-relative -R app lib vendor