Sam Donaldson wrote:> Hi,
>
> I''ve limited my error_messages_for method to just spit out the
first
> error it has in the object but the problem is that the first error is
> not always the one that gets printed out. If I have a form, and if
> there were multiple erorrs, then I''m finding that the first
logical
> error on the form is not being printed out. I would like to always just
> print out the first logical error. What sequencing does rails follow
> while adding errors into the errors object. How can I accomplish this.
> I definitely don''t want all the errors printed out.
>
> Thanks.
>
> --
> Posted via http://www.ruby-forum.com/.
Not sure, but I would bet that it is related to the order in which you
define your validations.
BTW, you can mash your errors for one field together by doing this..
@item.errors.on(''field'').to_sentence
_Kevin
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---