ruby on rails - Kaminari and Sunspot undefined method page -


i trying return records match search in kaminari , paginate results. however, getting following error:

undefined method 'page' 

my controller code:

@search = sunspot.search(building) fulltext params[:search] end @buildings = @search.results.page(params[:page]).per(15) 

i think not understanding how use kaminari?

page method can call in relation, can this:

@buildings = building.where(id: @search.results.map(&:id)).page(params[:page]).per(5) 

Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -