Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails ERB <%- ... -%> vs. <% ... %> [duplicate]

Tags:

Possible Duplicate:
Difference between -%> and %> in rails

So for an ERB file, what's the difference between <%- ... -%> vs. <% ... %>? As far as I can tell, they serve the same purpose but one requires more typing than the other.

like image 350
Bob Avatar asked Oct 07 '09 06:10

Bob


1 Answers

Using the dash removes the whitespace around the ERB tag, there is a RailsCast that talks about this and some other View tricks.

like image 176
Mike Buckbee Avatar answered Dec 08 '22 19:12

Mike Buckbee