我正在尝试显示所有用户并想要对它们进行分页 我添加了这两个宝石:
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.
任何帮助?