I'm trying to handle complex form (nested forms) validation. (Using
this link as http://railscasts.com/episodes/75-complex-forms-part-3 as
how I'm setting up the complex forms.)
Things are working ok, except that I'm getting a few extra messages to
the base that I don't want once the children forms are validated. For
example if dealing with a Project mode and Task models as children...
I'll end up with an extra " Tasks is invalid" message for every Task
that is invalid, which doesn't look good considering the task
validation messages are also showing up.
What I'd like to do is to be able to remove the extra "Tasks is
invalid" messages that show up in my "after_validation" method (unless
someone can recommend a better thing to do?)
The problem is I can't figure out how to remove messages from the
errors.each do |field,message|
if field == "tasks"
#errors >> field ?Is there a way I can remove the message?