Today I Learned

hashrocket A Hashrocket project

Strip HTML tags in Rails Views

Rails ActionView::Helpers::SanitizeHelper includes a super handy method strip_tags that removes html tags from a string.

strip_tags("

Hello World Paragraph

") #=> Hello World Paragraph strip_tags("Cool Link!") #=> Cool Link!

Read more about it here

Looking for help? Hashrocket has been an industry leader in Ruby on Rails since 2008. Rails is a core skill for each developer at Hashrocket, and we'd love to take a look at your project. Contact us and find out how we can help you.