Last Updated: February 25, 2016
·
1.671K
· sapienza

Kaminari pagination with Arel

<a href="https://github.com/amatsuda/kaminari" target="blank">Kaminari</a> supports <a href="https://github.com/rails/arel" target="blank">Arel</a>, and it's really simple integrate it!
let's say that _
collection__ is a collection queried by Arel.

collection = Model.method(params)
@collection = Kaminari.paginate_array(collection_from_arel).page(params[:page]).per(20)