Reputation: 103
I have created my layout in application.html.erb.
I want to include a few dynamic fields provided from the view. In application.html.erb file I have:
<p style="margin-left: 45px">
<%= yield ( :article_heading ) %>
</p>
Then in static_page/home.html.erb I have:
<% provide(:article_heading, 'Contact NùRùmie') %>
The HTML is not being properly parsed. Instead of producing the accent marks, it returns the string exactly.
Upvotes: 0
Views: 48
Reputation:
x = "this is some <p>html content</p>"
if in your view you do
<%= x %>
then you'll get exactly that string, but this will be interpreted as html code if you do
<%= x.html_safe %>
Upvotes: 1