hello
what this “-” for?
thanks!
hello
what this “-” for?
thanks!
On Sun, Jun 14, 2009 at 3:54 PM, tivrfoa[email protected] wrote:
hello
what this “-” for?
thanks!
-%> strips the trailing whitespace and newline.
<%- strips leading whitespace but not newline.
So
<% if foo %>
bar
<% end %>
generates " \n bar\n \n" whereas
<%- if foo -%>
bar
<%- end -%>
generates " bar\n"
This is especially useful in templates for plain-text emails.
jeremy
Thanks Jeremy! So it has no effect in html.erb files, i.e., in the
views, right? I tested here and nothing changed.
Here is a page that maybe can help someone:
http://springyweb.com/documents/1
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs