This module allows Ruby programs to clean up any HTML document or fragment coming from an untrusted source and to remove all dangerous constructs that could be used for cross-site scripting or request forgery.
Dmitry Borodaenko
gem "whitewash", "~> 2.0"