Forum: Rails deployment How to validate presence of phone number or mobile phone

Posted by Thriving K. (thriving)
on 2009-09-28 13:49
In my model of user.rb

there are phone number and mobile number.

i want to validate if phone number and mobile number are exist or
not(not neccessary to do both).

how to do that
Posted by Smit Shah (smit_shah)
on 2009-09-29 13:03
Thriving K. wrote:
> In my model of user.rb
> 
> there are phone number and mobile number.
> 
> i want to validate if phone number and mobile number are exist or
> not(not neccessary to do both).
> 
> how to do that

Write following code in model.

validates_presences_of :field_name
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.