添加Kaminari配置文件,并给出了比较详细的注释
This commit is contained in:
parent
a47cb8eb65
commit
ff80bea0c2
|
@ -0,0 +1,32 @@
|
||||||
|
# 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
|
||||||
|
# config.window = 4
|
||||||
|
# config.outer_window = 3
|
||||||
|
# config.left = 0
|
||||||
|
# config.right = 0
|
||||||
|
# config.page_method_name = :page
|
||||||
|
# config.param_name = :page
|
||||||
|
end
|
Loading…
Reference in New Issue