Search code examples
ruby-on-railshtml-entitieslink-to

HTML Entities in Rails link_to


How do I insert HTML entities in a rails link_to?

For instance &#10029 will give you a star character, how do I insert this inside a quote?

For example,

<%= link_to " &#10029 Home", root_path %>

Thanks!


Solution

  • Try this:

    <%= link_to raw("&#10029 Home"), root_path %>