In my home controller I have

@list = Igraci.page(params[:page]).per(1)

In the index view

<%= paginate @list %>

and got this error:

undefined method 'page' for #<Class:0x235f256>
有帮助吗?

解决方案

Make sure you have gem 'kaminari' in your Gemfile, that you run bundle and restarted the server.

Additionally, someone had the same issue as you, and their solution was to require kaminari in config/application.rb just before require 'rails/all'.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top