2017-04-06 77 views

回答

0

創建應用程序/配置/初始化一個kaminari.rb和,如u已經will_paginate啓用

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

,在初始化創建will_paginate.rb和,

if defined?(WillPaginate) 
    module WillPaginate 
    module ActiveRecord 
     module RelationMethods 
     def per(value = nil) per_page(value) end 
     def total_count() count end 
     def first_page?() self == first end 
     def last_page?() self == last end 
     end 
    end 
    module CollectionMethods 
     alias_method :num_pages, :total_pages 
    end 
    end 
end 

這應該工作積極管理with will_paginate

相關問題