-
Notifications
You must be signed in to change notification settings - Fork 505
Order of create? #37
Comments
Hmm, I thought since it uses the current time as a creation id it would build them in that order, but I guess not. Time to investigate. |
Are you experiencing this problem as well? Or did I do something wrong on my part? |
I haven't seen this behavior in the nested_form branch of the complex-form-examples project, but I haven't tested it extensively. You may want to check that out and see if you get the same behavior. |
I'm having the same problem. To reproduce:
When creating the new child forms, they do use the current time. If you inspect a field after the validation error, though, they all reset to 0-5, in the wrong order. If you do the same thing, but building 1 child object in the controller instead of 2, it works fine. Hopefully that helps. |
@subtractiv thanks for the detailed response. This may be an issue with how nested attributes works in Rails, but I'll research it and see if there's a way to fix it here. If someone has ideas please submit a pull request. |
I can confirm this issue. However, before I used an old version where new nested fields didn't have "new_" prefix and it worked fine (I used it with up to 100 new records and the order was always the same as entered). Could this "new_" prefix be removed? Or is it risky that new id would match existing? |
This problem still persists. "1333432769586"=>{"partnercomment"=>"6", "expenditure"=>"", "status"=>"1", "_destroy"=>"false", "id"=>"", "time4"=>"0", "time3"=>"0", "time2"=>"0", "time1"=>"0"}, I recently upgraded my bundles and suspect javascript timestamp saved in wrong manner after that upgrade. |
Could you please push a test application reproducing this issue? Thanks. |
I bumped into this bug recently. It seems to be not related to nested_issue. It's Rails and Ruby compatibility issue. Everything works fine with 1.9.* Rubies, but bug appears with 1.8.7. I guess this bug should either be forwarded to RoR issues or forgotten as legacy bug... |
Closing as this issue seems not being related to nested_form. |
When I create a record with nested attributes, the nested attributes tend to be created in a seemingly random manner- I added each nested field in order, and filled them with values from 1-5. However, it gets created in a random order: => 5 3 1 2 4. It's different every time.
So then when I go edit, the form displays the fields in that order as well.. which the user might find confusing.
Is there a way to let it create the records from top to bottom?
The text was updated successfully, but these errors were encountered: