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

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -