Why don't you use 'validates_format_of' instead? You can use a regexp
and make sure there are only numbers and dashes. Here is the
documentation page:

http://api.rubyonrails.org/classes/ActiveRecord/Validations/ClassMethods.html#M002168

On Jan 25, 6:50 am, Srikanth Jeeva <[email protected]> wrote:
> Hi,
>
> I am using validates_numericality_of :phone_number
>
> for validation of phone number. The phone number must also accept "-".
>
> for Example, "044-42652144"
>
>  Can any one please help how to do it,
>
> Thanks,
> Srikanth Jhttp://srikanthjeeva.blogspot.com
> --
> Posted viahttp://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to