In Rails, how can I allow some html in a text area?

Norm picture Norm · May 14, 2010 · Viewed 12.9k times · Source

I have a Rails app (blog) that I am creating. Very basic stuff. In my content area I have a text area for the content of the post. I am needing to include some html in the text area (links, formating, etc).

<%= f.text_area :content %>

Is there another tag that I can use instead of text_area, that will allow me to do this?

Answer

MorningHacker picture MorningHacker · Jul 10, 2011

Have you tried this in the views?

 <%= content.html_safe %>