我对如何让 Kaminari 工作有点问题。我在 GitHub 中完成了安装过程。
gem "kaminari"
然后运行
bundle
我有这个索引片段
@users = User.order("name")
我在我的视图中添加了这个
<%= paginate @users %>
然后我得到了这个错误。
undefined method `paginate' for #<#<Class:0x00000102934330>:0x00000102932508>
我错过了什么吗?我也尝试包含页面方法
@users = User.order("id").page(1)
但我得到了这个错误
undefined method `page' for #<ActiveRecord::Relation:0x000001017d0300>