Print in ERB without <%=?

Cheng picture Cheng · Nov 15, 2009 · Viewed 24.2k times · Source

Sometimes it's more convenient to print in <%%>. How to do it in Rails?

Answer

Omar Qureshi picture Omar Qureshi · Nov 15, 2009

http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#method-i-concat

Should be what you are looking for.

E.g. the following statement using concat:

<% concat "Output" %>

is equivalent to:

<%= "Output" %>