The repo aims to replace the default Rails snippets from Sublime Text and make it useful for the latest Ruby and Rails versions. All the snippets can be found in this cheatsheet generated by Snipcheat.
➜ cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages
➜ git clone https://github.com/tadast/sublime-rails-snippets.git Rails
It is important to clone it into a folder called Rails. Some Sublime plugins have hardcoded dependencies pointing to that path. See troubleshooting.
Look for "Ruby on Rails snippets". Here's how to install packages
rm ~/Library/Application\ Support/Sublime\ Text\ 2/Settings/Session.sublime_session
This will lose all session data (Sublime will 'forget' open filetabs, projects, search history etc.)
If Sublime complains it can't find Ruby on Rails.tmLanguage
, chances are you are using this hack.
You'll need to change the path where it looks for that file. Here's the forked version which works with this plugin.
You may also need to change Packages/(DetectSyntax|User)/DetectSyntax.sublime-settings
to replace/include this rule
{
"name": "Ruby on Rails snippets/Ruby Haml",
"rules": [
{"file_name": ".*\\.haml$"}
]
},
{
"name": "Ruby on Rails snippets/Ruby on Rails",
"rules": [
{"function": {"name": "is_rails_file"}}
]
}
Ruby on Rails snippets
is a default instalation directory for Package Control.
If you installed in a different directory, change the path accordingly
You may need to tell Sublime to prefer Rails
View -> Syntax -> Open all with current extension as...
and pick Rails
of Ruby on Rails snippets
- Fork it
- Create your feature branch for each group of snippet changes that could be merged individually (
git checkout -b my-new-snippet
) - Commit your changes (
git commit -am 'Add some snippet [tab_trigger]'
) - Commit messages should start with a verb in present simple tense and have all affected tab triggers in square brackets e.g. "Add a snippets for partial rendering [rpc, rpo]"
- Push to the branch (
git push origin my-new-snippet
) - Create new Pull Request