Am trying to do filtering part. Filtering means, when user selects some choices based on that product details will be displayed. If user selects women (department) and men department it should display all the products which belongs to both women and men. To do this I am using sunspot and concatenating two objects. It is working fine. But when am trying to do pagination using Kaminari it works fine if user selects only one department like women.
If user selects both men and women then it is throwing an error like:
undefined method `current_page' for Array
Am doing the above mentioned work like the following code.
deptids=["1" "2"]
deptids.each do |did|
@search_res=ProductDetail.search do
with :department_id, did
paginate :page=>params[:page], :per_page=>15
end
end
Please can any one tell that how to do pagination for array of objects using Kaminari Gem?
Please tell me how to do array of objects pagination using Kaminari or how to append two objects into one single object