Rails fields_for ordering -


i have form has nested fields - ie. user accepts_nested_attributes_for class.

class has end_date datetime field.

i'd order classes end_date in editing form. form has this:

<%= f.fields_for :classes |builder| %>   <%= render "class_fields", {:f => builder} %> <% end %> 

obviously, come out in order of created_at field.

how can modify order them arbitrary field?

if want classes sorted way, can add :order option association. if not, fields_for takes second argument that's record(s) display, can pass in list in whatever order want.


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -