What does <%== %> do in rails erb? What does <%== %> do in rails erb? ruby-on-rails ruby-on-rails

What does <%== %> do in rails erb?


<%== is equivalent to raw.

From the Ruby on Rails Guide:

To insert something verbatim use the raw helper rather than calling html_safe:

<%= raw @cms.current_template %> <%# inserts @cms.current_template as is %>

or, equivalently, use <%==:

<%== @cms.current_template %> <%# inserts @cms.current_template as is %>


Rails actually uses Erubis instead of ERB, which supports a variety of other stuff.

<%== is exactly as you expect, though: It emits the value unescaped