Instant Gratification #2

Dave says:

I just added and removed the minus signs in the erb_loops.rhtml template and looked at the page source.

Anonymous says:

So what did you see happen?

Sydneystephen 8 Jan 07 11:12am:

I could not see any difference with or without the "-" sign at the end of the ERB—the HTML code generated is the same.

Raul says:

the insertion of the '-' sign makes a difference only with the <% xyz %> statements, not with the <%= xyz %> ones (as in the latter case, the line returned contains the text generated and there is no 'extra blank line').

Eg: in list.rhtml, edit top line as: % for product in @products -%> and you will see the difference (previous blank line is gone).

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License