Ruby

From wiki.kungfootek.net
Revision as of 11:42, 1 August 2016 by Daniel Baker (talk | contribs) (Added spaces regex for vim)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Little Helper snippets

Finding errant spaces in VIM

^\(\s\s\)\+


Stolen from : http://stackoverflow.com/questions/7996695/what-is-the-difference-between-and-in-erb-in-rails

Executes the ruby code within the brackets.

<% %>

Prints something into erb file or otherwise outputting the results of Ruby code.

<%= %>

Avoids line break after expression.

<% -%>

Comments out code within brackets; not sent to client (as opposed to HTML comments).

<%# %>

The double equal means that the string is not escaped, as in raw.

<%== %>