Question

I'm trying to paginate my search results from metasearch but I get a

undefined method `paginate' for #<ActiveRecord::Relation:0x6d3df28>

This is the code in my controller :

@search = Camping.search(params[:search])

if !params[:search].nil?
  @campings = @search.paginate(:page => params[:page])
else
  @campings = [];
end

This should be so simple I really don't see what's wrong...

I have those in my gem file :

gem 'will_paginate', '3.0.3'
gem 'bootstrap-will_paginate', '0.0.6'
Was it helpful?

Solution

So yes this was dumb, just forgot to restart the server after installing the gem

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top