I want to hook the validation routines so that I can flag html labels and change their color to better indicate which fields need to be corrected in a form. Is there a way to do this conveniently and/or conventionally? -- Posted via ruby-forum.com. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at groups.google.com/group/rubyonrails-talk?hl=en.
On Feb 19, 4:14 pm, Ralph Shnelvar <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I want to hook the validation routines so that I can flag html labels > and change their color to better indicate which fields need to be > corrected in a form. > > Is there a way to do this conveniently and/or conventionally?Have a look at field_error_proc Fred -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at groups.google.com/group/rubyonrails-talk?hl=en.
On 19 February 2010 16:14, Ralph Shnelvar <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I want to hook the validation routines so that I can flag html labels > and change their color to better indicate which fields need to be > corrected in a form. > > Is there a way to do this conveniently and/or conventionally?you can interrogate the model errors to see what fields are invalid, but it''s easier to use a plugin that someone else has already done the same thing in. I''ve recently used Formtastic to generate forms and the resultant helpful, highlighted errors. github.com/justinfrench/formtastic -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at groups.google.com/group/rubyonrails-talk?hl=en.
Michael Pavling wrote:> On 19 February 2010 16:14, Ralph Shnelvar <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> I want to hook the validation routines so that I can flag html labels >> and change their color to better indicate which fields need to be >> corrected in a form. >> >> Is there a way to do this conveniently and/or conventionally? > > you can interrogate the model errors to see what fields are invalid, > but it''s easier to use a plugin that someone else has already done the > same thing in. I''ve recently used Formtastic to generate forms and the > resultant helpful, highlighted errors. > github.com/justinfrench/formtasticThanks, Michael. I have tried formtastic and have found it more of a hassle than a help. Maybe I''m just not seeing the benefits. - - - Thanks, Frederick, I''ll look at field_error_proc. -- Posted via ruby-forum.com. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at groups.google.com/group/rubyonrails-talk?hl=en.