An atom package to add snippets for Ruby on Rails projects.
Developed with Ruby 1.9 syntax (
key: 'value') and rails 5 onwards in mind, but most snippets work on older versions 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.
Support .html.erb and .html.haml templates
Toggle with: cmd + >
(In american keyboard: shift + cmd + .)
In your atom configuration file (
config.cson). Insert each erb block you'd like as an array with the first element as the opening erb and the 2nd element as the closing erb into rails-snippets's erbBlocks configuration array.
As an example of how'd look like:
# config.cson "*": # all your other configs... "rails-snippets": erbBlocks: [ ['<%=', '%>'] ['<%', '%>'] ['<%#', '%>'] ]
If you can stick to the default (above) you don't have to do anything. Otherwise add or remove erb blocks in the order you'd like.
The conventions for the snippets are usually the initials for the method.
<%= link_to 'hi', path %>is
ltand 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
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
jpjoins & proc
Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.