Simoroshka Simoroshka - 26 days ago 7
Ruby Question

What is the meaning of <%%= in Ruby on Rails?

I cannot find it anywhere but in the project I am working with.
It doesn't work in the same way as

<%=
(I tried to change), but I can't understand the difference.

<span class="option-content" placeholder="<%=t('pages.edit.option')%>">
<%%= content %>
</span>

Answer

The ERB dock here says

<% Ruby code -- inline with output %>
<%= Ruby expression -- replace with result %>
<%# comment -- ignored -- useful in testing %>
% a line of Ruby code -- treated as <% line %> (optional -- see ERB.new)
%% replaced with % if first thing on a line and % processing is used
<%% or %%> -- replace with <% or %> respectively

this means the

<%%= content %>

will will be replaced with

<%= value of content %>
Comments