fix slow pagination
This commit is contained in:
parent
753344554c
commit
c6dbb79061
|
@ -8,9 +8,7 @@ class Admin::WebResourcesController < OrbitAdminController
|
||||||
@filter_fields = filter_fields(@categories, @tags)
|
@filter_fields = filter_fields(@categories, @tags)
|
||||||
@table_fields = [:status, :category, :title]
|
@table_fields = [:status, :category, :title]
|
||||||
|
|
||||||
@links = Kaminari.paginate_array(
|
@links = WebLink.order_by(sort).with_categories(filters("category")).with_tags(filters("tag")).with_status(filters("status")).page(params[:page]).per(10)
|
||||||
WebLink.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