I am using a rails application with a stone kaminari
, and I have a shared array that I am trying to use on a page using the paginate_array method, but I get an ArgumentError (the wrong number of arguments (2 for 1) . Here is the code:
def index
page = params[:page] || 1
items = ClientReports.search(params[:search], sort_column, sort_direction)
@clients = Kaminari.paginate_array(items, total_count: items.count).page(page)
respond_with(@clients)
end
Line: Kaminari.paginate_array(items, total_count: items.count).page(page)
is the one that throws the error. Why is this a problem? From what I see in the docs , it is shown that this should be fine.
source
share