Write your own validate routine instead of using the helpers.
On Sep 29, 11:32 am, "Thriving K." <rails-mailing-l...@andreas-s.net>
wrote:
> I found another problem when i use this code
>
> validates_presence_of :mobile_number,:if => :phone_number_blank_check
> validates_presence_of :phone_number,:if => :mobile_number_blank_check
>
> def phone_number_blank_check
> self.phone_number.blank?
> end
>
> def mobile_number_blank_check
> self.mobile_number.blank?
> end
>
> when both field leave blank, it happened two message told that
> mobile_number can't be blank and phone_number can't be blank
>
> i want it to appear only one message tell that
> phone number or mobile number can't be blank, how could i do that.
> --
> 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 rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---