Sha256: eec2f2396879a5020dc2cfd7d2face0eb4ae4f7813a85fd6f6efeaa314a6e4de
Contents?: true
Size: 1016 Bytes
Versions: 3
Compression:
Stored size: 1016 Bytes
Contents
# Phone number support for Rails Simple handling for phone numbers in rails apps. Make the aggressive assumption that a valid phone number is a 10 digit number. Users can input numbers in any format so long as they contain exactly 10 numeric digits. Phone numbers will be stripped of all non-numberic characters before being saved, so your database contains just normalized numbers. Valid numbers include "1231231234", "123-123-1234", and "(123) 123 1234". ## Installation Add this line to your application's Gemfile: gem 'rails_phone' Or install it yourself as: $ gem install rails_phone ## Usage Add `has_phone_number`: class Person has_phone_number end This will assume an attribute `:phone` exists. If you'd like to set it up on a custom set of attributes just pass them in: class Person has_phone_number :cell, :mobile end ## Development Uses a test rails app: cd test/dummy rake db:migrate rake db:test:prepare rake test (from project dir)
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
rails_phone-1.1.1 | README.md |
rails_phone-1.1.0 | README.md |
rails_phone-1.0.0 | README.md |