Fix sorting for archive

This commit is contained in:
chris 2013-03-27 06:30:22 +08:00
parent 41311c74d0
commit ec1605358b
3 changed files with 4 additions and 4 deletions

View File

@ -98,7 +98,7 @@
</tfoot>
<tbody>
<% @archive_file.archive_file_multiples.desc("id asc").each_with_index do |archive_file_multiple, i| %>
<% @archive_file.archive_file_multiples.asc(:_id).each_with_index do |archive_file_multiple, i| %>
<%= f.fields_for :archive_file_multiples, archive_file_multiple do |f| %>
<%= render :partial => 'form_file', :object => archive_file_multiple, :locals => {:f => f, :i => i} %>
<% end %>

View File

@ -20,7 +20,7 @@
<div class="o-archives-list-item">
<% if !post.archive_file_multiples.blank? %>
<ol>
<% post.archive_file_multiples.desc("id asc").each do | afile | %>
<% post.archive_file_multiples.asc(:_id).each do | afile | %>
<% if afile.file.file and afile.choose_lang_display(I18n.locale.to_s) %>
<li>
<%= link_to afile.file_title, afile.file.url, {:target => '_blank', :title => afile.file_title, :class => "o-archives-file"} %>

View File

@ -22,7 +22,7 @@
<div class="o-archives-list-item">
<% if !post.archive_file_multiples.blank? %>
<ol>
<% post.archive_file_multiples.desc("id asc").each do | afile | %>
<% post.archive_file_multiples.asc(:_id).each do | afile | %>
<% if afile.file.file and afile.choose_lang_display(I18n.locale.to_s) %>
<li>
<%= link_to afile.file_title, afile.file.url, {:target => '_blank', :title => afile.file_title, :class => "o-archives-file"} %>
@ -72,7 +72,7 @@
<% if !post.archive_file_multiples.blank? %>
<ol>
<% post.archive_file_multiples.desc("_id asc").each do | afile | %>
<% post.archive_file_multiples.asc(:_id).each do | afile | %>
<% if afile.file.file and afile.choose_lang_display(I18n.locale.to_s) %>
<li>
<%= link_to afile.file_title, afile.file.url, {:target => '_blank', :title => afile.file_title, :class => "o-archives-file"} %>