ERB templates and comments

When you use one line Ruby comments in ERB templates you should never do this (notice the whitespace in front of #):

<% # my comment %>

<div>my html</div>

This leads to strange html output. To avoid long debugging sessions, you should never have a whitespace before the # character (but newline is allowed)

<%# this works as expected %>

<%
    # this works, too
    # foo bar baz
%>
Ulrich Berkmüller