Skip to content

Instantly share code, notes, and snippets.

@leandroh
Created November 10, 2016 18:50
Show Gist options
  • Save leandroh/7a22ba4af195195202a451f7e17e1631 to your computer and use it in GitHub Desktop.
Save leandroh/7a22ba4af195195202a451f7e17e1631 to your computer and use it in GitHub Desktop.
Strips all HTML tags in Ruby
class String
def strip_tags
self.gsub(/<\/?[^>]*>/, '') if self
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment