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
  • 2 hours ago
  • 12 years ago

Installs

  • Total 9K
  • Win 1K
  • Mac 5K
  • Linux 3K
May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27 Apr 26 Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30
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