Forum: Ruby on Rails custom validation method on nested model

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
8eb783216f0052775d2c2da6a85350d7?d=identicon&s=25 Benny (Guest)
on 2012-11-02 22:59
(Received via mailing list)
I can't get the field_with_errors div's to wrap around nested fields in
a
fields_for block when using a custom validation method in the parent
model.
e.g. there needs to be at least one order detail record associated with
an
order. I add the error to the parent model errors hash however I can't
get
the key to match the form field so that the wrapping div's get applied.
This does work for local attributes and for validation in the actual
nested
model. Can anybody tell me how to get the keys in the error's hash to
match
the nested fields in my form?
8eb783216f0052775d2c2da6a85350d7?d=identicon&s=25 Benny (Guest)
on 2012-11-05 20:26
(Received via mailing list)
Never mind I figured this out.
This topic is locked and can not be replied to.