Search code examples
htmlruby-on-railsredcloth

How do I render RedCloth html in a view in Rails3?


In rails 2, I use <%=h %> to display HTML-generated by RedCloth, but how do I do that in Rails 3?

<%= raw RedCloth.new(@review).to_html %>

Solution

  • Use <%= raw %>.

    Reference: raw vs. html_safe vs. h to unescape html