Browse the Ruby on Rails Community.

You are here: Browse Railsplugins Sanitized

Sanitized

= Sanitized

Cleans up fields prior to saving.

Usage
  1. Specify the fields and say which sanitization to apply. class Person < ActiveRecord::Base sanitized :fields => [ :name, :description, :alias, :location, :country_name], :apply => [:clean] sanitized :fields => [ :homepage_url ], :apply => [:fix_links] end
Apply Options

:clean - strips and white lists :white_list - uses the white list plugin :strip - strips whitespace from start and end of field :fix_links - ensure url's given are proceed with http://

Note: More than one sanctification may be applied to a set of applied e.g. [:clean, :fix_links]

Notes

Tests require updating

Credits

Largely based on Alex Paynes Acts as sanitized plugin. See http://www.al3x.net.

NOTE: This description has been extracted from the Plugin README and so the formatting may need updating to make browser friendly

Users


See all details


Membership

+ Join this railsplugin

Record Maintainer

'None'