This question already has an answer here:
I have been going through a crash course of Ruby and Ruby on Rails and i can't figure this out: In embedded ruby html files, there are several tags. <% %> for execution <%= %> for output, but what function do these tags serve: <%= -%>, what's with the "-" sign at the end ?
Thanks.
In ruby document there is not the details about this usage
<%-
or-%>
. But it works well by this:erbA = ERB.new(erbA_str, 1, '-', "@output_buffer")
Notice the 3rd parameter
'-'
! It removes the pre or post blanks when using<%-
and-%>
accordingly.This link contains a good overview of erb markup.
From the site: