On Feb 13, 11:29 pm, ericindc <[email protected]> wrote:
> I want my first check to verify email address uniqueness. If this
> validation fails, there's no reason to go further with validating the
> user's input. I want a singular message displayed in this case. Is
> there a way to do this?
I think the best way would be to use your own function (instead of
error_messages_for) for displaying the error. You might also be able
to get somewhere with the :if option to validations (and have your if
function check whether there are any errors yet). While the examples
you provide are interesting, more generally it is really annoying as a
user to have to correct form errors once at a time.
Fred
>
> Also, what about group validations, such that, for example, if I have
> several checks on a password (existence, complexity, confirmation) and
> one fails, the others are ignored. So for instance, if the password
> field does not match its confirmation, I skip validating the password
> complexity.
>
> What's the best approach to this? Thanks.
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---