Skip to content

A rails plugin that sanitizes specified attributes in a model. Uses the sanitize gem.

License

Notifications You must be signed in to change notification settings

alainbloch/html_sanitizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HtmlSanitizer

A simple wrapper for the sanitize gem to easily sanitize attributes in your model. The sanitization is done using a before_save callback.

Example

Lets say you have a User model that has a name, and a description. In the User model simply enter:

html_sanitizer :sanitize => [:name, :description]

If you wanted to customize the sanitizer (read the sanitize gem), simply add to the options hash:

html_sanitizer :sanitize => [:name, :description], :options => Sanitize::Config::RESTRICTED

================================================================ Copyright (c) 2009 RubyMiner LLC, released under the MIT license

About

A rails plugin that sanitizes specified attributes in a model. Uses the sanitize gem.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages