Forum: Ruby on Rails custom validation method on nested model

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
fields_for block when using a custom validation method in the parent
e.g. there needs to be at least one order detail record associated with
order. I add the error to the parent model errors hash however I can't
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
model. Can anybody tell me how to get the keys in the error's hash to
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.
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.