Created
April 21, 2010 16:12
-
-
Save ryenski/374028 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From http://zylstra.wordpress.com/2008/03/12/a-kinder-gentler-phone-number-validation/ | |
validates_format_of :phone, | |
:message => "must be a valid telephone number.", | |
:with => /^[\(\)0-9\- \+\.]{10,20} *[extension\.]{0,9} *[0-9]{0,5}$/i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment