fix slow pagination
This commit is contained in:
parent
8501592f1c
commit
b11f537a67
|
@ -14,9 +14,7 @@ class Admin::AnnouncementsController < OrbitAdminController
|
||||||
@filter_fields = filter_fields(@categories, @tags)
|
@filter_fields = filter_fields(@categories, @tags)
|
||||||
@table_fields = [:status, :category, :title, :start_date, :end_date, :last_modified]
|
@table_fields = [:status, :category, :title, :start_date, :end_date, :last_modified]
|
||||||
|
|
||||||
@bulletins = Kaminari.paginate_array(
|
@bulletins = Bulletin.order_by(sort).with_categories(filters("category")).with_tags(filters("tag")).with_status(filters("status")).page(params[:page]).per(10)
|
||||||
Bulletin.order_by(sort).with_categories(filters("category")).with_tags(filters("tag")).with_status(filters("status"))
|
|
||||||
).page(params[:page]).per(10)
|
|
||||||
|
|
||||||
if request.xhr?
|
if request.xhr?
|
||||||
render :partial => "index"
|
render :partial => "index"
|
||||||
|
|
Loading…
Reference in New Issue