Closed xqwztis closed 10 years ago
The problem was due to Chamber attributes in the form being enclosed in <div> with class "fields", which lead to blank context variable in javascript, which in turn resulted in the newly generated chamber instance not attributed to its parent.
Hi
I'm trying to build a 3-level nested form (Ovary -> Formation -> Chamber), where Ovary is declared with a class_name to allow two ovaries be saved in the same table for each examination record.
However, when I try to create a sample record as shown on the screenshot
The resulting view output is incorrect, because instead of creating a chamber under one formation, the application creates two formations, one is blank with the child chamber assigned to it, the other formation has no chamber but has correct data from the form.
Probably this is because of incorrect nesting of the parameters passed by the controller:
https://gist.github.com/xqwztis/6163228
A sample application that has the problem can be found here: https://github.com/xqwztis/nested_form_issue.
Any ideas why this could be happening?