On Wednesday, April 10, 2013 9:53:01 AM UTC+1, Lukáš Doležal
wrote:>
> Hi everybody,
>
> I needed change field error rendering for some forms created with
Rail''s
> form builder. I found solution by changing ActionView::Base::field_error_
> proc to own before form and changing it back after form rendered.
>
> I don''t like this solution :) It''s not thread-safe (but
it''s not so
> important, nobody really wants it :), but I don''t like it because
of I
> think it isn''t good object desing.
>
> Yuck - I''ve been there before (although I stored the override in
Thread.current so that it was thread safe).
How complicated would be adding some extra option to formbuilder, like
> :form_field_error_proc, that can be propagated down to the
ActiveRecord''s
> InstanceTag implementation?
> Or have you some other idea how to make this better? :)
>
> Last time the interaction between that and all the various helpers was a
little gnarly. Personally I''ve taken not to using field_error_proc and
just
adding classes on the inputs (or on its enclosing element) to indicate
invalidness. field_error_proc could definitely use some love though
Fred
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/Rt5TBO5IvMwJ.
For more options, visit https://groups.google.com/groups/opt_out.