srb*_*ert 6 plugins pagination ruby-on-rails
是否有一个rails插件可以按字母顺序进行分页/导航?
我有一个非常大的数据集,并且除了1..2 ... 3 ... 4 ... 5分页外,更喜欢为用户提供更直接的导航提示.
我可以自己编写代码但是想知道是否有一个像样的插件已经可以为我做了.
为什么不能将要查看结果的字母表作为参数传递?然后对结果进行分页?那是,
# show results of params[:alphabet] alphabet
@results = fetch_results(params[:alphabet])
# Use Will Paginate to fetch results internally and give a condition that
# fetches results starting with the passed alphabet.
Run Code Online (Sandbox Code Playgroud)
<%= will_paginate @results %>并在视图上使用显示分页结果(编号) 。
| 归档时间: |
|
| 查看次数: |
2904 次 |
| 最近记录: |