fix slow pagination

This commit is contained in:
manson 2014-05-21 15:55:42 +08:00
parent 753344554c
commit c6dbb79061
1 changed files with 1 additions and 3 deletions

View File

@ -8,9 +8,7 @@ class Admin::WebResourcesController < OrbitAdminController
@filter_fields = filter_fields(@categories, @tags)
@table_fields = [:status, :category, :title]
@links = Kaminari.paginate_array(
WebLink.order_by(sort).with_categories(filters("category")).with_tags(filters("tag")).with_status(filters("status"))
).page(params[:page]).per(10)
@links = WebLink.order_by(sort).with_categories(filters("category")).with_tags(filters("tag")).with_status(filters("status")).page(params[:page]).per(10)
if request.xhr?
render :partial => "index"