试图了解will_paginate的paginate
方法的选项:帮忙翻译will_paginate文档?
:page — REQUIRED, but defaults to 1 if false or nil
:per_page — defaults to CurrentModel.per_page (which is 30 if not overridden)
:total_entries — use only if you manually count total entries
:count — additional options that are passed on to count
:finder — name of the ActiveRecord finder used (default: “find”)
page
,per_page
和finder
非常简单。
total_entries
and count
- 不明白“只有手动计数条目时才使用”?他们是否设想了一种场景,您将运行单独的计数查询,然后将结果作为选项传递给paginate
?你会这样做的情况是什么?
“传递给计数的附加选项” - 有哪些选项可用? “传递”到count
方法???
提供:total_entries似乎没有工作了。 COUNT(*)查询仍然在数据库中 – 2012-11-21 06:35:57