Ok, I checked the doc but I don't fully understand:
- First what is the "-" you was talking about? I can't see any
reference to this
The first line about ERb says "You trigger ERb by using embeddings
such as <% %>, <% -%>, and <%= %>"
- Second about this:
"If you absolutely must write from within a function use concat.
suppress leading and trailing whitespace, including the trailing
newline, and can be used interchangeably with ."
So you did see it - the "suppress leading and trailing whitespace"
line that you quote part of (which probably due to HTML emails has
gotten fubared) is talking about <%- and -%>.
Does it means I have to use functions to display my contents? I don't
No. It says "if" - some people insist on doing smelly things - like
rendering output while they're in functions - and *if* someone insists
on doing that, it's better to use "concat" than to use ERb tags. But
it's better yet to *not* output from functions at all.
If you have a partial that does this:
<% if true %>
The outcome of the statement is <%= "true" %>
<% end %>
...if you look in the source, you'll see some extra whitespace. If you
care about getting rid of it at all (for the most part, I don't), you
could do this instead:
<%- if true -%>
The outcome of the statement is <%= "true" -%>
<%- end -%>
... or someone who spends more time fiddling with the rendering of
Rails apps than I do will probably tell you that an *even better*
solution is to use something like HAML. All these options are choices
for you (since you were raising the issue of white-space) - nothing is
set in stone.