1

This is a cool problem. I have some videos on Wistia. I ask for the videos and I embed them into the site. That was fun. Now I want to grab the description. This is what I got:

<p> This is a description.</p>

I was expecting those <p> tags not to actually render as HTML. I'm assuming this is for security reasons.

One solution is to remove the tags with a reg ex and wrap around manually. Does anyone have any other ideas?

BenMorganIO
  • 2,036
  • 17
  • 37
  • This should help: [rails: how to html encode/escape a string? is there a built-in?](http://stackoverflow.com/questions/692921/rails-how-to-html-encode-escape-a-string-is-there-a-built-in) – vee Mar 24 '14 at 00:06

1 Answers1

1

Guess you could just sanitize it:

in a controller:

ActionController::Base.helpers.sanitize st, tags: %w()

in a view you can just

<%= sanitize st, tags: %w() %>
emcanes
  • 1,398
  • 10
  • 7