ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Rails Related Files

by luqman ST2

Ruby on Rails Project Navigation Made Easy

Details

  • 2016.06.08.21.47.06
  • github.​com
  • github.​com
  • 8 years ago
  • 16 minutes ago
  • 12 years ago

Installs

  • Total 9K
  • Win 1K
  • Mac 5K
  • Linux 3K
Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9 Mar 8 Mar 7 Mar 6 Mar 5 Mar 4 Mar 3 Mar 2 Mar 1 Feb 29 Feb 28 Feb 27 Feb 26 Feb 25 Feb 24 Feb 23 Feb 22 Feb 21 Feb 20 Feb 19 Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13 Feb 12 Feb 11 Feb 10 Feb 9 Feb 8 Feb 7 Feb 6 Feb 5 Feb 4
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

Sublime Text 2/3 - Rails Related Files

Note: I've never written any Python code before! So feel free to implement best practices and make a pull request.

This plugin allows you to easily navigate your Rails projects by making a few basic assumptions. I wrote this so I didnt have to constantly use the SideBar to lookup files!

Ok, so lets imagine you “right clicked” on the following file/s (Screenshot 2) or by using the “CMD+Shift+O” shortcut (Screenshot 1) it will search for files:

posts_controller.rb under app/controllers

If it was under the “admin” namespace e.g. app/controllers/admin/posts_controller.rb then it will look under views/admin/posts/** and vice versa.

views/posts/** - All files under this folder
models/post**  - Models starting with "post"

show.html.erb under app/views/posts

models/post**             - Models starting with "post"
views/posts/**            - All files in this folder
assets/javascript/post**  - Any javascript file starting with "post"
assets/stylesheets/post** - Any stylesheet file starting with "post"
controllers/post**        - Any controller file starting with "post"

post.rb model under app/models

models/post**         - Models starting with "post"
views/posts/**        - All files in this folder
views/**/posts/**     - All files in this folder (e.g. admin namespace)
controllers/post**    - Any controller starting with "post"
controllers/**/post** - Any controller starting with "post" (e.g. admin namespace)

If you want to disable the context menu, just edit the Rails.sublime-settings file changing “show_context_menu” to false.

Future

Maybe we can extract the possible partials being used in the current file e.g. render "post" or even render @posts, we know where to look > app/views/posts/_post

Screenshots

Here I've pressed the shortcut key when looking at the “page.rb” file under models.

Quick Panel

Context Menu

Contributors

Credits