An atom package to add snippets for Ruby on Rails projects.
Developed with Ruby 1.9 syntax (key: 'value'
) and rails 4 onwards in mind, but most code in the snippets is going to work on Rails 3 too.
Contributions are greatly appreciated, if your favorite snippets are missing open an issue or send a pull request, I would ❤️ to merge your favorite snippets.
Please fork this repository and open a pull request to add / improve snippets.
-
Snippets with nice defaults that are definitely going to save your a lot of time.
Toggle with: cmd + >
(In american keyboard: shift + cmd + .)
The conventions for the snippets are usually the initials for the method.
Examples:
- For
validates_presence_of
isvpo
- For
has_and_belongs_to_many
ishabtm
- For
<%= link_to 'hi', path %>
islt
and so on.
Also if the method has an optional block like content_tag
(snippet is ct
), its block it's going to be adding block
to the shortcut, in this case ctblock
Here are some of my favorites snippets, a complete list of snippets can be seen directly at the code or once the package is installed at Settings > Packages > Rails Snippets
p
rocl
ambdabd
Between datesj
oinsjp
joins & proc