我在时间表和时间表之间有一个accepts_nested_attributes_for 关联。这很好用,但是当我想输出时间表时,这些行会根据时间表记录的 ID 进行排序。相反,我想订购“daynr”字段上的行。我怎样才能做到这一点?代码是这样的:
<% for timesheetline in timesheet.tms_timesheetlines %>
<%= timesheetline.daynr %>
<%= timesheetline.description %>
<% end %>