Home > attr_sanitizer

attr_sanitizer

Attr_sanitizer is a project mainly written in Ruby, based on the MIT license.

simple as possible attribute sanitation

= AttrSanitizer =

Based on rgrove's sanitize gem, simple as possible attribute sanitizer.

== Requires ==

  • [[https://github.com/rgrove/sanitize|sanitize]]

== Example ==

assuming that Foo class has title field:

{{{ class Foo < ActiveRecord::Base atrr_sanitizer :title end }}}

By default attr_sanitizer calls sanitize_attributes on before_save, but You can call it whenever You want.

{{{ f = Foo.new f.title = "works" f.sanitize_attributes.title # => "works" }}}

== Instalation ==

{{{ script/plugin install attr_sanitizer }}}

Copyright (c) 2010 pasierb, released under the MIT license