Reputation: 2185
I'm pulling product descriptions from Amazon and they arrive escaped, looking like <i>New York Times</i>
When I use h, raw or html_safe it shows up in my application as <i>New York Times</i>
But I'd really like it to show up as New York Times
Upvotes: 2
Views: 911
Reputation: 3985
Try this:
<%= CGI.unescapeHTML("<i>New York Times</i>").html_safe %>
The issue is that the string contains html that has already been escaped. So, you need to 'unesacpe' it first.
Upvotes: 2