Jim Burgess
2011-Jul-16  22:11 UTC
Is it possible to manually wrap a form field in a field_with_errors div after validation?
I am adding an error to a field in a form thus:
company.errors.add_to_base("Please select either distributor or
manufacturer")
However, the add_to_base method doesn''t wrap the field where the error
occurred in a field_with_errors div, and thus the field isn''t
highlighted.
Is there any way to achieve this manually?
I tried adding a nil error to the attribute:
company.errors.add(:isVertrieb, nil), but this results in the field''s
name being output in the list of validation errors.
-- 
Posted via http://www.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
http://groups.google.com/group/rubyonrails-talk?hl=en.