Cocoon populating form in reverse order

jchaike

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.

Optimus Pette

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Populating UICollectionView in reverse order

From Dev

Cocoon autocomplete Modal populating dynamic fields twice

From Dev

Capybara form value set with cocoon

From Dev

Cocoon callbacks after form reload

From Dev

Capybara form value set with cocoon

From Dev

populating a dynamic form with javascript

From Dev

Symfony form handleRequest not populating

From Dev

populating form with mysql data

From Dev

populating a dynamic form with javascript

From Dev

nested_form_fields gem vs cocoon

From Dev

Rails - Cocoon - Simple Form - does not render

From Dev

Rails, Cocoon, Nested form not saving correctly

From Dev

Nested form(cocoon gem) not visible in view rails

From Dev

HTML table form with multiple inheritance, in cocoon?

From Dev

Order and reverse order by group?

From Dev

Request DTO populating order and validation

From Dev

Populating Purchase order tables in mysql

From Dev

Re-populating form field

From Dev

Re-populating form field

From Dev

Populating a calculated value into another form

From Dev

Ajax dont works populating a form

From Dev

nested_form/cocoon: is it okay to use table rows for nested fields?

From Dev

Rails cocoon nested form only receiving one first nested attribute

From Dev

4.2 Without cocoon, simple form or formtastic? Nested forms cookbook

From Dev

Rails nested form - refactor create action | cocoon gem

From Dev

Database not recognizing dynamically generated instances of model in form using Cocoon

From Dev

Rails nested form with cocoon. Attributes using model

From Dev

Rails materialize-sass form with autocomplete and cocoon gem nested resource

From Dev

Push into vector in reverse order

Related Related

HotTag

Archive