Add pagination at backend index page

This commit is contained in:
manson 2014-07-04 15:54:11 +08:00
parent f4d405979b
commit d9194eae26
2 changed files with 8 additions and 2 deletions

View File

@ -27,7 +27,7 @@ class ArchiveFile
field :rss2_sn
# scope :can_display,where(is_hidden: false)
scope :can_display, ->{where(is_hidden: false).asc(:sort_number, :title).desc(:is_top)}
scope :can_display, ->{where(is_hidden: false).order_by(:is_top=>-1, :sort_number=>1, :title=>1)}
# belongs_to :archive_file_category

View File

@ -27,4 +27,10 @@
</tr>
<% end %>
</tbody>
</table>
</table>
<%=
content_tag :div, class: "bottomnav clearfix" do
content_tag :div, paginate(@archives), class: "pagination pagination-centered"
end
%>