Rails File Switcher plugin for Sublime Text 2
I've recently released a plugin for Sublime Text 2 called Rails File Switcher. It allows you to quickly switch between Models, Controllers and Views in your Rails application.
The plugin provides you with the following 3 commands:
- open_related_rails_model — switches to
Post
model fromPostsController
orposts/index
view. - open_related_rails_controller — switches to
PostsController
fromPost
model orposts/index
view. - open_related_rails_view — switches to
posts/index
view fromPostsController
when the cursor is inside theindex
action.
The plugin does not create any key bindings automatically, it's up to you to add them. My personal preference is to bind them to super + 1|2|3
, but you can do whatever you want.
Go to Preferences
> Key Bindings - User
and add:
{ "keys": ["super+1"], "command": "open_related_rails_model" },
{ "keys": ["super+2"], "command": "open_related_rails_controller" },
{ "keys": ["super+3"], "command": "open_related_rails_view" },
You can install the plugin through Package Control, just search for Rails File Switcher
.
RailsFileSwitcher is in alpha, so if something is not working correctly, create in issue on Github.
You're the 13146th person to read this article.