Consider this
<div> <% if @some_var == some_value %> <p>Some message</p> <% end %> </div>
The above code outputs to the HTML below if @some_var is some_value
<div> <p>Some message</p> </div>
If you put in the closing tag, then the ERB interpreter will delete new lines for those who have a code tag, including
<div> <p>Some message</p> </div>
This is useful if you need good HTML code. Sometimes you find it useful when working side by side with a designer.
Hope this helps.
Netmustang
source share