I am attempting to validate a phone number field to assure that it is
only 10 digits. I’ve placed the following code in my model:
validates_length_of :phone, :is => 10, :message => “should be 10
digits.”, :allow_nil => true
However, even when 10 digits are entered (with no dashes or parentheses)
I still receive a validation error.
Any help would be appreciated. Thanks.