Domanda

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>
È stato utile?

Soluzione

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'.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top