From c6dbb79061f2e7703fde6df91fac531d800f9370 Mon Sep 17 00:00:00 2001 From: manson Date: Wed, 21 May 2014 15:55:42 +0800 Subject: [PATCH] fix slow pagination --- app/controllers/admin/web_resources_controller.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/controllers/admin/web_resources_controller.rb b/app/controllers/admin/web_resources_controller.rb index 43615bb..4ce80a6 100644 --- a/app/controllers/admin/web_resources_controller.rb +++ b/app/controllers/admin/web_resources_controller.rb @@ -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"