Case .. when in view

I noticed something odd:

In a view, i’m using the case/when, but the strange thing is that
rails/ruby can’t seem to handle whitespace in front of the “when”
statement:

      <% when :string then -%>

generates:

compile error
script/…/config/…/app/views/inside/admin/_form.rhtml:26: parse error,
unexpected tIDENTIFIER, expecting kWHEN
_erbout.concat " "; when :string then
^

allthough

<% when :string then -%>

works…

Seems like a bug to me…