How does one NOT html_encode a variable in rails?

Posted by deadkarma on Stack Overflow See other posts from Stack Overflow or by deadkarma
Published on 2010-03-30T01:57:24Z Indexed on 2010/03/30 2:03 UTC
Read the original article Hit count: 273

Filed under:

With Rails, If I have a variable with HTML content, how do I output it, unencoded in my view file?

This code, for example:

<% my_variable = "<b>Some Bolded Text</b>" %>
<%= my_variable %>

Outputs:

&lt;b&gt;Some Bolded Text&lt;/b&gt;

© Stack Overflow or respective owner

Related posts about ruby-on-rails