The “-%>” causes ERb to suppress the newline on any output. If you have
output, it will not have an ending newline, if you have no output, you
will not get meaningless blank lines.
It only seems to be documented in the ERb.rb source code:
( Do a find on :ExplicitTrimRegexp )
The ERb documentation says you can suppress newlines with the trim_mode
setting, but does not say what the default trim_mode character is.
Mark H. wrote:
I seen some RoR code that went like this:
<% if …blah, blah… -%>
… blah, blah
<% end -%>
What are the minus signs for in the if statement? Cannot seem to find
anything about this, and searching on “-” in this context is hard to get
anything meaningfull back.