Subscribe

Ruby 1.8.7 and ERB gotcha

Dec
8

While pairing with Bo on a new project, we were stumped with an odd issue with random HTML going missing.

It turns out <% # comment %> is not the same as <%# comment %>. Using <%# comment %> also comments all HTML until the next %> on another line after the initial comment.

So:

<% # comment %>
foo
<%= 'hello' %>
bar

Will print

hello
bar

but

<%# comment %>
foo
<%= 'hello' %>
bar

will print the intended result of

foo
hello
bar

Solution: Find and replace all instances of <% # with <%#.

2 Responses to “Ruby 1.8.7 and ERB gotcha”

  1. July 21, 2010 at 6:11 pm


    MedicamentSpot.com. Canadian Health&Care.Best quality drugs.No prescription online pharmacy.Special Internet Prices. High quality pills. Order pills online

    Buy:Maxaman.Tramadol.Soma.VPXL.Viagra Soft Tabs.Cialis Soft Tabs.Super Active ED Pack.Viagra Super Force.Viagra.Propecia.Cialis Professional.Cialis Super Active+.Zithromax.Viagra Super Active+.Levitra.Viagra Professional.Cialis….


  2. LED
    August 31, 2010 at 5:50 am

Leave a Reply