ActionView::Helpers::SanitizeHelper
def strip_tags(html)

Description

Returns the string with all tags removed.

Arguments

"<b>Fish</b> & <script>alert(1)</script>Chips"
Removes all tags, keeping only their content as text (the content of <script> is kept too). The returned string is already escaped (& becomes &amp;, " becomes &quot;, ' becomes &#39;, etc.), leaving already escaped parts such as &amp; as is (though a character reference such as &copy; may be turned back into its character), and marked as html_safe, so <%= %> does not escape it again.

ERB

Changes from the previous output: Added Removed Changed


          

HTML