I've been at this for a few hours and cannot seem to figure it out.  I have 
a sinatra application, which retrieves a data from a database and creates a 
Post object.  A field/attribute of post is named content 
(ie:  post.content) , which contains html data.  I'm attempting to display 
this content "AS HTML" in haml, but not having any luck.

In my haml form I have an @post object.  The @post.content = <h1 
style="text-align: center;">COOL</h1> <p>&nbsp;</p> <p>cool&nbsp;<span 
style="color: #ff0000;">beans</span>&nbsp;man</p> .
How do I display this in a haml page as actual html and not just a string 
of useless nonsense?

I've tried many things and it just displays the sting of html instead of 
actually displaying the html "AS HTML" in the page.

ie:
#{@post.content}
!= #{@post.content}
= @post.content

I've tried dozens of other methods posted online, but for the life of me 
cannot figure it out.  I think rails has something like html_safe.

If I put something like "<h1>HELLO</h1> in the haml page it displays fine.

Any help is greatly appreciated.  Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to haml+unsubscr...@googlegroups.com.
To post to this group, send email to haml@googlegroups.com.
Visit this group at http://groups.google.com/group/haml.
For more options, visit https://groups.google.com/d/optout.

Reply via email to