The easiest way to do this is to use html_safe or raw functions
= link_to 'Other Page<span class="icon"></span>'.html_safe, "path/to/page.html"
or using the raw function (recommended)
= link_to raw('Other Page<span class="icon"></span>'), "path/to/page.html"
Just as soon as possible!
Do not use the html_safe method unless you are sure your string is non-zero. Instead, use the raw () method, which will not throw an exception on nil.
Nikhil Nanjappa Feb 11 '14 at 15:08 2014-02-11 15:08
source share