-
Notifications
You must be signed in to change notification settings - Fork 506
unknown attribute error when submitting multiple records in double-nested form #51
Comments
Commenting out lines 15-31 in nested_form.js bypasses the problem, if that's any help. Those lines are:
|
Thanks for reporting this issue. I don't have time at the moment to research this, but it will be very helpful once I get a chance. |
Thanks Ryan. No rush at all – you do so much for the community as it is. But let me know if I can provide any additional info or testing. |
Just to give you an update, the plan is to get a good test suite in place next, see issue #22 for this. Then we can duplicate problems like this and find a concrete solution and ensure nothing else breaks. If you have input on testing please comment there. |
@cmezak Could you please test with the latest nested_form version? I'd be helpful if you provided a test application reproducing this issue. Thanks! |
Closing for now. Will reopen if there is still an issue. |
I'm using nested_form for a situation where:
Parent (climb) ==has_one==> Join Model (route_ascent) ==polymorphic has_many==> Children (route_step)
So I have a climb object that looks like
Here's RouteAscent
And Here's RouteStep
In my Climb form I have
My _route_ascent_fields partial is simply
And my _ascent_step_fields partial is
The problem I have is that whenever I submit the form with more than one object in the join model's has_many association, I get an unknown attribute error. Here's what the parameters look like that are generated by the form in such a case:
It looks like the second object is not being included correctly in the parameters, but I haven't been able to figure out why this is so.
The problem occurs whether or not the has_many association starts out with an object or not. So If it is empty, I can successfully create a single object but not two. If It already has one object, I can't add a second without getting this error.
Will continue to work on this, but I'd appreciate any insight as to what the problem might be!
The text was updated successfully, but these errors were encountered: