When I use content_tag, my t开发者_如何学Pythonags get converted to their HTML entity equivalent. The code I use is
The view renders
Hello This is a <strong>test</strong>
When I'd like it to render
Hello This is a test
The content format of the database is text
, which may or may not affect the output, since there are newlines and return carriages within the content.
You should tell Rails the content is safe. Two options:
your_content.html_safe
<%=raw your_content %>
精彩评论