How to render HTML inside Slim templates
You want to disable HTML escaping for the link_to
argument, not the entire link_to
result. You're pretty close with your html_safe
but your string interpolation is eating your "safe for HTML" flag. This should work better:
li= link_to '<i class="icon-user"></i> My Profile'.html_safe, current_user
This has been answered, but if you actually have some html and you want to render it in a slim template, use double equal.
== "<i>test</i>"
Will be the same as
= "<i>test</i>".html_safe