2017-04-06 3 views

答えて

0

アプリ/設定/初期化子でkaminari.rbを作成し、

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

uはwill_paginate有効にしているとして、初期化子で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

関連する問題