What is the rule driving the order of high-levels validations ?
In my model owner.rb, I do first a
validates_presence_of :name :city :phone
then, If there is an email address, I validate it using :
validates_format_of :email_address, :with =>
/^([^@\s]+)@((?:[-a-z0-9]+.)+[a-z]{2,})$/i,
:if => Proc.new { |record| record.email_address != ‘’ }
testing it, with no name, no city, no phone, but with a wrong
email_address, I get normally all 4 errors-
but not in the correct order…
- name
- city
- emaill_address
- phone
which is not related to the order of the fields in my form…
is there any way to get the list of error messages in relation with the
list of the field in the form ??