I''ve been studying Rails source code to figure out how to clear ActiveRecord errors for a given attribute name. It appears that there is no direct API to do that. The best workaround I found is this: active_record.errors.add(attribute_name, "dummy").clear Basically, "add" returns an array of error messages for given attribute name, which I subsequently clear. Seems to work, but doesn''t feel "right". In case anyone wonders why in the world I needed such functionality, here is a brief explanation. I have an object with a has_many association. If any of the children fail validation, the following error is displayed for the parent object: "(insert association name here) is invalid". I do not find this particular error message to be very informative and instead would rather display exact children errors. Hence, I would like to make a sweep over parent object errors and remove any errors on associations after validation but before rendering. If anyone has any better suggestions on better displaying children errors, I am all ears :) Regards, Fyodor Golos -- 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-/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?hl=en -~----------~----~----~----~------~----~------~--~---