4

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>
bensiu
  • 24,660
  • 56
  • 77
  • 117
user1879099
  • 43
  • 1
  • 3

2 Answers2

5

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

rorra
  • 9,593
  • 3
  • 39
  • 61
0

In my case I forgot to add the kaminari gem to my Gemfile :facepalm:

Dorian
  • 7,749
  • 4
  • 38
  • 57