fix slow pagination

This commit is contained in:
manson 2014-05-21 15:56:06 +08:00
parent bf7dc45fd0
commit cc527b069c
1 changed files with 1 additions and 1 deletions

View File

@ -15,7 +15,7 @@ class Admin::FaqsController < OrbitAdminController
categories = params[:filters][:category].blank? ? [] : params[:filters][:category] rescue [] categories = params[:filters][:category].blank? ? [] : params[:filters][:category] rescue []
tags = params[:filters][:tags].blank? ? [] : params[:filters][:tags] 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? if request.xhr?
render :partial => "index" render :partial => "index"