I have a field in my user model:
<p><label for="user_work_phone">Work phone</label><br/>
<%= text_field 'user', 'work_phone' %></p>
But I only want to validate it if it is non-empty. So I put this into
my user model:
validates_as_phone :work_phone, :if => !:work_phone.blank?
&& :is_client?, :message => "is not a valid phone number"
But if I leave the field blank and submit the form, the form is
returned to me with the message "Work phone is not a valid phone
number:". What is wrong with the above statement?
Thanks, - Dave