2015-01-31 10:47:09 +08:00
|
|
|
|
# Time 2015-01-30 17:04:12
|
|
|
|
|
# Author lizanle
|
|
|
|
|
# Description kaminari配置文件
|
|
|
|
|
# <%= paginate @users, :window => 2 %>
|
|
|
|
|
# 则展示页会像 5 6 7 8 9 ,当7是当前页的时候
|
|
|
|
|
|
|
|
|
|
# <%= paginate @users, :outer_window => 3 %>
|
|
|
|
|
# 分页展示会像 1 2 3 4 ...(snip)... 17 18 19 20 当总共有20个页面的时候
|
|
|
|
|
|
|
|
|
|
# <%= paginate @users, :left => 1, :right => 3 %>
|
|
|
|
|
# 分页展示会像 1 ...(snip)... 18 19 20 当总共有20个页面的时候
|
|
|
|
|
|
|
|
|
|
# <%= paginate @users, :param_name => :pagina %>
|
|
|
|
|
# 这样子会将每个链接传进去一个参数 :pagina
|
|
|
|
|
|
|
|
|
|
# <%= paginate @users, :params => {:controller => 'foo', :action => 'bar'} %>
|
|
|
|
|
# 这样子将会修改每个链接的控制器和动作. :controller and :action
|
|
|
|
|
|
|
|
|
|
# <%= paginate @users, :remote => true %>
|
|
|
|
|
# 这将会使每个链接使用ajax方式,极其简单,非常完美的工作。data-remote="true"
|
|
|
|
|
|
|
|
|
|
#更多知识详见 https://github.com/honwlee/kaminari
|
|
|
|
|
Kaminari.configure do |config|
|
|
|
|
|
# config.default_per_page = 25
|
|
|
|
|
# config.max_per_page = nil
|
2015-11-26 09:57:53 +08:00
|
|
|
|
config.window = 1
|
2015-01-31 10:47:09 +08:00
|
|
|
|
# config.outer_window = 3
|
2015-11-26 09:57:53 +08:00
|
|
|
|
config.left = 2
|
|
|
|
|
config.right = 2
|
2015-01-31 10:47:09 +08:00
|
|
|
|
# config.page_method_name = :page
|
|
|
|
|
# config.param_name = :page
|
|
|
|
|
end
|