format_validators

A consolidation of a few of the most common validations.

What do we validate

Bundler

gem "format_validators"

Install

gem install format_validators

Examples:

Like all validations these lines go in the model.

Currency

validates :total, :currency_format => true
validates <field>, :currency_format => true

Florida Counties

validates :county, :florida_counties => true
validates <field>, :florida_counties => true

Phone Numbers

validates :phone_number, :phone_format => true
validates <field>, :phone_format => true

Social Security Number

validates :social, :ssn_format => true
validates <field>, :ssn_format => true

ZIP code

validates :zip, :zipcode_format => true
validates <field>, :zipcode_format => true

Contributing to format_validators

Copyright © 2012 Jeremiah Hemphill. See LICENSE.txt for further details.