What is the best way to go about getting embedded HTML in the body of a link generated with the link_to method?
I basically want the following:
<a href="##">This is a <strong>link</strong></a>
I have been trying to go about this as suggested in Rails and the <span> tag but with no luck. My code looks like the following:
def picture_filter #...Some other code up here text = "Show items with " + content_tag(:strong, 'pictures') link_to text, {:pics => true}, :class => 'highlight' end
#... <%=raw picture_filter %> #...
Try it this way
<%= link_to(raw("a <strong>strong</strong> link"),{:pics => true},{ :class => 'highlight'}) %>
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