My favorites | Sign in
Project Logo
                
Code license: MIT License
Labels: RubyonRails, Ruby
Feeds:
People details
Project owners:
  jerrodblavos

Validates As Phone

Validates a US telephone number with or without area code, and without regard to the different input formats.

( e.g. (xxx)xxx-xxxx or xxx.xxx.xxxx or xxx-xxx-xxxx )

Usage:

class Model < ActiveRecord::Base
  ...
  validates_as_phone :telephone, :fax,
                      :message => "is not a valid US phone number"
  ...
end








Hosted by Google Code