title: Ruby on Rails pagination using Kaminari gem for array of objects
body: <p>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.</p>
  
  <p>If user selects both men and women then it is throwing an error like:</p>
  
  <blockquote>
    <p>undefined method `current_page' for Array</p>
  </blockquote>
  
  <p>Am doing the above mentioned work like the following code.</p>
  
  <pre><code>deptids=["1" "2"]
  deptids.each do |did|
      @search_res=ProductDetail.search do
          with :department_id, did                  
          paginate :page=&gt;params[:page], :per_page=&gt;15
      end
  end
  </code></pre>
  
  <p>Please can any one tell that how to do pagination for array of objects using Kaminari Gem?</p>
  
  <p>Please tell me how to do array of objects pagination using Kaminari or how to append two objects into one single object</p>