I have a string with html tags in it saved.
=> "<p>hey man this is crazy g funk</p>\n<p>here i come with another crazy message from..</p>\n<p>dj eassssy d!@#!.</p>"
How do you parse this so that it displays the way the HTML tags are implying?
I tried:
= Post.text
=h Post.text
= RedCloth.new(Post.text).to_html
= Hpricot(Post.text)
You want to do this:
<%= raw Post.text %>
or in haml
= raw Post.text
The reason is because rails escapes your html and will convert <p>
into <p>
.