Sublime Forum

Rails File Switcher

#1

Switch between your Rails models, controllers and views with 1 keystroke!

Unlike other “related files” plugins, RailsFileSwitcher does not show you a list of files at all, it instantly switches to the related file.

The plugin provides you with the following 3 commands:

open_related_rails_model — switches to Post model from PostsController or posts/index view.
open_related_rails_controller — switches to PostsController from Post model or posts/index view.
open_related_rails_view — switches to posts/index view from PostsController when the cursor is inside the index action.

You can install the plugin using Package Control, search for Rails File Switcher.

Here’s an article on my blog that goes into details: say26.com/rails-file-switcher-pl … ime-text-2

The source can be found at github.com/AlexanderZaytsev/Sub … leSwitcher

0 Likes

#2

Here are some updates since the initial release:

  1. Works with multiple apps opened in the sidebar.
  2. You can put the cursor inside a model’s name and run open_related_rails_model to switch to it.
  3. When switching from a view to the controller action, the screen is centered at that action.
  4. Namespaces are now supported: Foo::Bar model will bring you into foo/bar_controller.rb.

github.com/AlexanderZaytsev/Sub … #changelog

0 Likes