How would you convert this HTML into the Rails content_tag
helper syntax/format?
<p class="msg">
<span class="strong">Most people enjoy the inferiority of their best friends.</span>
<br>
<span class="emphasize"> - Lord Chesterfield</span>
</p>
to be precise with classes added. You can also use blocks with content_tags if you have a bunch of lines.
content_tag(:p, :class => 'msg') do
content_tag(:span, "Most ... friends.", :class => "strong") +
content_tag(:br) +
content_tag(:span, "- Lord .. ", :class => "emphasize")
end
Is this what you're looking for?
content_tag(:p, content_tag(:span, 'Most people enjoy the inferiority of their best friends.') + '<br/>' + content_tag(:span, ' - Lord Chesterfield'))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With