In my opinion, I want to display some quotes with a right angle in my link.
Before Rails 3, this worked:
<%= link_to "» #{@category.name}", some_path %>
Now what should I do if I want to specify »as html_safe, but not all the link text?
In other words, I do not want to do this:
<%= link_to "» #{@category.name}".html_safe, some_path %>
I do not want to @category.namebe considered as html_safe.
This gives the desired result:
<%= link_to "»".html_safe + " #{@category.name}", some_path %>
However, if I do this:
<%= link_to "#{@category.name}" + "»".html_safe, some_path %>
The output of angle quotes is not considered safe. I see »on my page, not & raquo ;.
Why?
I tried to extract a "»".html_safehelper method with the same results.
Is there a way to easily label hardcoded text / characters as safe HMTL in Rails 3?
Thank.