Is there a mean to specify the messages order that are displayed by a
error_messages_for?
I see that we can specify the objects order. But what about the
messages related to a same object.
Let say I have an Order.
In my form I have the following order:
Name
Address
Email
Payment type
and in my model I have:
validates_presence_of :name, :address, :email, :pay_type
validates_format_of :email, :with => /\A([^@\s]+)@((?:[-a-z0-9]+.)+
[a-z]{2,})\Z/i
However I get the following order for the error messages:
* Name can’t be blank
* Pay type can’t be blank
* Address can’t be blank
* Email is invalid
* Email can’t be blank
Obviously I would like the same order as in the form.
Is it possible with error_messages_for ?