Example: I have a form_for "Party" where you can create many "People", using Cocoon to build the fields_for People. I create 3 people in this order:
Person1
Person2
Person3
I save the form, and then go back to edit the form. I am presented with the people in this order:
Person3
Person2
Person1
Is there any reason for this? I assume that it just has to do with the way cocoon recalls the data, most recent to oldest. However, I would like the form to show the People in the same order that they were created.
Add a default scope to your person.rb
like this:
default_scope { order('created_at ASC') }
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments