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
Post a Comment