Sha256: 2a80a5d962d39533110dd946f27c4d54a0c98e6890a3ec4c0d4c825165c49cf5

Contents?: true

Size: 913 Bytes

Versions: 1

Compression:

Stored size: 913 Bytes

Contents

= ValidatesTelephone {<img src="https://secure.travis-ci.org/plribeiro3000/validates_telephone.png" />}[http://travis-ci.org/plribeiro3000/validates_telephone]

Rails gem to validate Telephone.

== Install

gem install validates_telephone

== Usage

Lets say you have a model with "telephone" string column that you want to be a valid telephone. Just add this to your model:

class User < ActiveRecord::Base
    validates :telephone, :telephone => true
end

== Test

This gem has matchers for shoulda-matchers and remarkable.

If you are using shoulda-matchers, add this line to your spec_helper.rb :
    require "validates_telephone/shoulda-matchers/validate_as_telephone_matcher"
If you are using remarkable, add this line to your spec_helper.rb :
    require "validates_telephone/remarkable/validate_as_telephone_matcher"

== Future

Add Support for other countries. For now it only supports Brazil telephones.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
validates_telephone-0.1.0 README.rdoc