I've noticed that in some lines of rails views, this is used:
<% # Code... -%> 
instead of:
<% # Code... %>
What is the difference?
    <ul>
    <% @posts.each do |post| -%> 
      <li><%=post.title%></li>
    <% end -%>
    </ul>
There will be no new lines in between the <ul> and first <li> and the last closing </li> and </ul>. If the - was omitted, there would.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With