0
<%= -%>
<%= %>

I am confused about this. Anyone can tell me details? Thank you in advance.

Daniel
  • 869
  • 2
  • 7
  • 19

1 Answers1

2

<%= %> prints something into ERB template

<%= -%> prints something into ERB template and avoids line break after expression.

Take a look here for details Why many people use "-%>" instead of "%>" in Rails?

Community
  • 1
  • 1
Rajdeep Singh
  • 17,621
  • 6
  • 53
  • 78
  • Thank you but I tried to iterate an array in both ways they generate the same html source code. – Daniel Nov 03 '14 at 07:20