【发布时间】:2016-06-16 17:51:00
【问题描述】:
我正在尝试显示我的所有用户并希望对他们进行分页 我添加了这两个宝石:
gem 'paginate', '~> 4.0', '>= 4.0.1'
gem 'bootstrap-will_paginate', '~> 0.0.10'
以下行给了我一个错误:
@users = User.paginate(page: params[:page])
我试过@users = User.all.paginate(page: params[:page])
和@users = User.paginate :all, :page => params[:page]
错误是:
You tried to define a scope named "paginate" on the model "ActiveRecord::SchemaMigration", but Active Record already defined a class method with the same name.
有什么帮助吗?
【问题讨论】:
标签: ruby-on-rails ruby pagination