Difference between %> into-%>

Experiment with adding and removing the minus sign at the end of the
ERb <%= %> sequence (i.e., changing %> into -%>, and vice versa.
what will be the difference

On Mon, Jun 30, 2008 at 5:24 PM, Lost W.
[email protected] wrote:

Experiment with adding and removing the minus sign at the end of the
ERb <%= %> sequence (i.e., changing %> into -%>, and vice versa.
what will be the difference

Putting a - sign at the end (like -%>) means that no new line will be
inserted into the template in the final output.

For example:

<%= ‘hello’ -%> there

Will result in “hello there”

<%= ‘hello’ %> there

Will result in: “hello\n there”

Rails, RSpec, Puppet and Life blog…