Reputation: 3576
I want to display some HTML in a XML view file (RSS) in rails:
# ...
xml.description raw("<![CDATA[ "+raw(news.content(@language).body)+"]]>")
# ...
This generates the following ...
<description type="html">&lt;![CDATA[ &amp;lt;p&amp;gt; ...
Any ideas?
Upvotes: 1
Views: 1952
Reputation: 121
After messing around with #raw
and #html_safe
, I found this to be working:
# ...
xml.description do
xml.cdata! news.content(@language).body
end
# ...
Upvotes: 4
Reputation: 25994
Hmm. html_safe should work. Maybe this will help you? http://yehudakatz.com/2010/02/01/safebuffers-and-rails-3-0/
Upvotes: 0