ruby on rails 3 - Pagination for partial array -
my application retrieves items remote source that:
# in controller @items = remotesource(params[:page])
the @items
array part of whole collection. , i'm trying paginate it:
# in view paginate @items
of course doesn't work.
how can paginate collection in such situation?
p.s. i'm using gem kaminari
try kaminari helper this: @books = kaminari.paginate_array(@items).page(params[:page])
Comments
Post a Comment