Low commit activity in last 3 years
No release in over a year
Validate phone numbers against E.164 format with this Ruby on Rails gem
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
~> 3.6
 Project Readme

validates_phone_format_of

CI Status Gem Version

Validate phone numbers against E.164 format.

Installation

validates_phone_format_of is distributed as a gem, which is how it should be used in your app.

Include the gem in your Gemfile:

gem 'validates_phone_format_of', '~> 3.0'

Usage

In your model

class User < ActiveRecord::Base

	validates :phone, phone_format: true
	# Or
	validates_phone_format_of :phone

	# Same thing as
	validates_format_of :phone, with: ValidatesPhoneFormatOf::Regexp
	# Or
	validates_format_of :phone, with: /\A\+\d{1,15}\z/

end

Others libraries useful

Author

License

This project is released under the MIT license. See the LICENSE file for more info.