How can I use strip_tags in regular Ruby code (non-rails)?
问题 I need to turn HTML into plain text. There's a nice function that does that in ActionView's SanitizeHelper, but I have trouble understanding how I can reference it and use it in a simple test.rb file. http://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html I would like to be able to call strip_tags("<b>lol</b>") => "lol" 回答1: The question is quite old, but I had the same problem recently. I found a simple solution: gem sanitize. It's light, works fine and has additional