Strip html from string Ruby on Rails

Mattias picture Mattias · Sep 14, 2011 · Viewed 96.3k times · Source

I'm working with Ruby on Rails, Is there a way to strip html from a string using sanitize or equal method and keep only text inside value attribute on input tag?

Answer

Jon picture Jon · Oct 17, 2012

If we want to use this in model

ActionView::Base.full_sanitizer.sanitize(html_string)

which is the code in "strip_tags" method