What is the meaning of <%%= in Ruby on Rails? -
i cannot find anywhere in project working with. doesn't work in same way <%=
(i tried change), can't understand difference.
<span class="option-content" placeholder="<%=t('pages.edit.option')%>"> <%%= content %> </span>
in short, erb processes double-percent marks single-percent marks.
it looks you're using 1 layer of erb templates generate layer of erb templates.
the first layer of erb doesn't need variable called content
, t
method:
<span class="option-content" placeholder="<%=t('pages.edit.option')%>"> <%%= content %> </span>
that first layer rendered produce second layer:
<span class="option-content" placeholder="edit"> <%= content %> </span>
as can see, erb template. expect else, later on, takes second erb , uses render like:
<span class="option-content" placeholder="edit"> hello, world. </span>
Comments
Post a Comment