Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

undefined method `page' for #<ActiveRecord::Relation:0xaadc8d4>

Im trying to install Kaminari pagination on rails 3 with adminpanel RailsAdmin, but I get this error:

NoMethodError in ShowsController#
undefined method `page' for # < ActiveRecord::Relation:0xaadc8d4>
like image 344
user1879099 Avatar asked Oct 26 '25 23:10

user1879099


1 Answers

Do you also have the gem "will_paginate" in use?

Check the file Gemfile.lock to see if you have this gem in use as well:

grep will_paginate Gemfile.lock

If that's the case, all you have to do is to create the file "config/initializers/kaminari.rb" and write this content on the file:

Kaminari.configure do |config|
  config.page_method_name = :per_page_kaminari
end

that should fix the issue

like image 94
rorra Avatar answered Oct 28 '25 17:10

rorra



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!