views:

63

answers:

1

In the web I've seen examples both with

<% if @showIt -%>
  some html content
<% end -%>

and without

<% if @showIt %>
  some html content
<% end %>

dash. Both versions work very well. So, what difference does it make?
Thanks!

+6  A: 

It's used to avoid inserting a newline after the code.

I found a very nice explanation here.

j.
Thanks, somehow googling didn't help me :)
Nikita Rybak