Active admin resolve kaminari and will paginate gem conflict issue

Add config/initializers/kaminari.rb

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

Add config/initializers/will_paginate.rb

if defined?(WillPaginate)
ActiveSupport.on_load :active_record do
module WillPaginate
module ActiveRecord
module RelationMethods
def per(value = nil) per_page(value) end
def total_count() count end
end
end
module CollectionMethods
alias_method :num_pages, :total_pages
end
end
end
end

Pagination example on active admin

controller do
def index
index! do |format|
@products=Product.all.page(params[:page])
format.html
end
end
end

 

Advertisements