From cc527b069c8ff7ffb61719b273f4f189ec82e052 Mon Sep 17 00:00:00 2001 From: manson Date: Wed, 21 May 2014 15:56:06 +0800 Subject: [PATCH] fix slow pagination --- app/controllers/admin/faqs_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/admin/faqs_controller.rb b/app/controllers/admin/faqs_controller.rb index 6a0845d..cded815 100644 --- a/app/controllers/admin/faqs_controller.rb +++ b/app/controllers/admin/faqs_controller.rb @@ -15,7 +15,7 @@ class Admin::FaqsController < OrbitAdminController categories = params[:filters][:category].blank? ? [] : params[:filters][:category] rescue [] tags = params[:filters][:tags].blank? ? [] : params[:filters][:tags] rescue [] - @qas = Kaminari.paginate_array(Qa.order_by(sort).with_categories(categories).with_tags(tags).with_status(status)).page(params[:page]).per(10) + @qas = Qa.order_by(sort).with_categories(categories).with_tags(tags).with_status(status).page(params[:page]).per(10) if request.xhr? render :partial => "index"