From: Brian Candler Date: 2011-03-07T06:36:59+09:00 Subject: Re: Blank lines generated by ERB - Can we prevent them? RichardOnRails wrote in post #985685: > I haven't been able to get rid of those blank lines. Is there a way? It looks like erb comments don't support the -%> way of preventing the blank lines. I tried both erb and eruby command-line tools. Regular ruby comments seem OK though: <% # Example from -%> <% # http://www.linuxtopia.org/online_books/programming... -%> This text is <% a = 100; print "#{a}% Live!" %> BTW it's bad practice to embed print inside erb (and you'll see the 'erb' command line tool gives unexpected results, maybe other erb implementations will too). This is because you may find erb being assembled into a buffer and then printed at the end. Much better to use <%= ... %> to embed output. For example: This text is <% a = 100 %><%= "#{a}% Live!" %> or: This text is <%= a = 100; "#{a}% Live!" %> -- Posted via http://www.ruby-forum.com/.