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)
Written by Bruno
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#