[英]paginate error while using will_paginate gem
I am trying to display all my users and want to paginate them I added these two gems : 我试图显示我所有的用户,并希望对他们进行分页,所以我添加了以下两个宝石:
gem 'paginate', '~> 4.0', '>= 4.0.1'
gem 'bootstrap-will_paginate', '~> 0.0.10'
The following line gives me an error : 以下行给我一个错误:
@users = User.paginate(page: params[:page])
I have tried @users = User.all.paginate(page: params[:page])
and @users = User.paginate :all, :page => params[:page]
我尝试过
@users = User.all.paginate(page: params[:page])
和@users = User.paginate :all, :page => params[:page]
The error is : 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.
错误是:
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.
any help ? 有什么帮助吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.