This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 105459 - Smart Navigation shortcut keys for Rails
Summary: Smart Navigation shortcut keys for Rails
Status: NEW
Alias: None
Product: ruby
Classification: Unclassified
Component: Navigation (show other bugs)
Version: 6.x
Hardware: All Linux
: P3 blocker (vote)
Assignee: issues@ruby
Depends on:
Reported: 2007-06-02 00:52 UTC by gnufied
Modified: 2011-01-28 20:10 UTC (History)
0 users

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description gnufied 2007-06-02 00:52:44 UTC
Its awesome that, We already have got Controller/View/Test switch key shortcuts.

But for a large rails project, default NBM shortcuts aren't enough. I expected,
GoToFile to fill the gap, but sadly it doesn't.

So what I propose is a set of navigational features just for rails. Its
basically lifted from Emacs and I think textmate also has same set of features.

Emacs has :
-> C-c,fc #=> Find in controllers
-> C-c,fv #=> Find in views
-> C-c,fs #=> Find in stylesheets
-> C-c,fj #=> Find in Javascript dir
-> C-c,fo #=> Find in config files
-> C-c,fg #=> Find in migrations

Anyone who has used Emacs and Rails, would swear by above bindings and how
useful they are.

Emacs also has another powerful feature:

In my view I have:

<%= render :partial => "foobar" -%>

Now, when i place caret cursor over "=>" and press Control-Enter, it takes me to
foobar partial!

I can do same from controllers also. It also follows redirect actions. Its
awesome in a word. 
We should have these in NBM.
Comment 1 Torbjorn Norbye 2007-06-02 16:51:36 UTC
I think the most natural way to support this in NetBeans would be to reuse the "goto declaration" feature - 
hold the ctrl key, and click on the files. This also has a keybinding - I think it's Meta-G for jump to the 
symbol under the caret. I'm doing something similar for "require" - if you're in a string associated with a 
require call I jump to the required file. In a Rails file, if I see a render call, jump to the associated view. 
Ditto for redirect etc.

Can you say more about why Go To File does not fill the gap? And what is "Find in" mean - bring up a Find 
dialog, or is it similar to Go To File but limited in scope to the current project and subdir?
Comment 2 gnufied 2007-06-02 19:24:28 UTC
Yes, you can use goto declaration to same purpose for following redirects and
render partials. I think, it amounts to the same.

Regarding, your GotoFile feature:

1. Its slow.
2. I am working on a really large rails project and most often it doesn't show
file, which i know is there. Its a difficult to reproduce error and my
experience varies with releases. And sorry for such a vague bug report. But I
wish I had more details.

In Emacs, "Find in xxxx" means, when i press above said key shortcut, Emacs asks
me to type the name of the file fully/partially in message area. The only
difference is unlike normal open/find file command of Emacs, this would look for
the file just in said directory.
Comment 3 Jiri Kovalsky 2007-07-03 14:14:25 UTC
Reassigning this issue to newly created 'ruby' component.