RailheadSanitize

RailheadSanitize is a Ruby on Rails plugin that automatically strips tags from input fields.

Installation

Installation is available as gem (recommended):

config.gem 'nagybence-railhead_sanitize', :lib => 'railhead_sanitize', :source => 'http://gems.github.com'

Or as Rails plugin:

$ ruby script/plugin install git://github.com/nagybence/railhead_sanitize.git

Usage

It works fully automatically, but there are two options to modify the default behavior.

Does not strip a parameter:

auto_sanitize :except => [:title]

Uses ‘sanitize’ instead of ‘strip_tags’:

auto_sanitize :allow_tags => [:body]

License

Copyright © 2008-2009 Bence Nagy ([email protected]), released under the MIT license.