Written by Sean Behan on Thu Apr 27th 2017

If you run into this error in development, using Rails 5 and Active Admin

NoMethodError - undefined method `per_page_kaminari'

Try the following.

First, make sure you have an initializer in your application.

# in config/initializers/kaminari.rb
Kaminari.configure do |config|
    config.page_method_name = :per_page_kaminari
end

If this doesn't do the trick, try adding the code to your application.rb file, at the bottom of the class.

module YourAppName
    class Application < Rails::Application
        Kaminari.configure do |config|
            config.page_method_name = :per_page_kaminari
        end 

        # custom requires here
        require "#{Rails.root}/app/models/your-custom-require-file.rb"
    end
end

Tagged with..
#Rails #ActiveAdmin #Kaminari

Just finishing up brewing up some fresh ground comments...