title: How to render HTML inside Slim templates
body: <p>I'm trying to render a link preceded by an icon. I'm using <a href="https://github.com/stonean/slim" rel="noreferrer">Slim</a> templating engine along with <a href="http://twitter.github.com/bootstrap/base-css.html#icons" rel="noreferrer">Bootstrap CSS</a>.</p>
  
  <p>Usually you could do this the following way:</p>
  
  <pre><code>&lt;a href="#"&gt;&lt;i class="icon-user"&gt;&lt;/i&gt; My Profile&lt;/a&gt;
  </code></pre>
  
  <p>According to Slim's documentation, we can use <code>==</code> to render without escaping HTML. So, translating this to Slim, I tried the following variations:</p>
  
  <pre><code>li== link_to "&lt;i class='icon-user'&gt;&lt;/i&gt; My Profile", current_user
  li== link_to "#{'&lt;i class="icon-user"&gt;&lt;/i&gt;'.html_safe} My Profile", current_user
  li= link_to "#{'&lt;i class="icon-user"&gt;&lt;/i&gt;'.html_safe} My Profile", current_user
  </code></pre>
  
  <p>All variations rendered <code>&lt;a href="/users/1"&gt;&lt;i class="icon-user"&gt;&lt;/i&gt; My Profile&lt;/a&gt;</code> escaping the <code>i</code> tag.</p>
  
  <p>How can I stop Slim or Rails from escaping html?</p>
  
  <p>(Rails 3.2 with Slim 1.2.1)</p>