nee*_*yes 3 will-paginate rails-admin ruby-on-rails-5
我为管理面板安装了“rails_admin”gem。我已经安装了 'will_paginate-bootstrap' gem。

ros*_*nd 5
在 app/config/initializers 中创建 kaminari.rb 并且,
Kaminari.configure do |config|
config.page_method_name = :per_page_kaminari
end
Run Code Online (Sandbox Code Playgroud)
当您启用 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
Run Code Online (Sandbox Code Playgroud)
这应该适用于有 will_paginate 的rails_admin
| 归档时间: |
|
| 查看次数: |
1731 次 |
| 最近记录: |