Javier Martinez a écrit :> With the helper "error_messages_on", if a method,
"price", for
> example, has 2 errors (numericality and presence), how can I access
> on both errors?
This is actually a Rails question, not a Spinoffs question. Next time,
post on RubyOnRails-Talk.
First, the helper you mention is error_message_on (singular), which
takes an object and a method name. It returns either nothing or a
HTML-formatted view of the FIRST error.
If you need all the errors for a given method only, you need to manually
lookup object.errors.on(yourMethodName) and work with the result, which
is a regular Array of String objects.
--
Christophe Porteneuve a.k.a. TDD
"[They] did not know it was impossible, so they did it." --Mark Twain
Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---