Ritu Rajora
Ritu Rajora

Reputation: 115

undefined method `page' for #<Mongoid::

When i am trying to click any tab/resource inside rails active admin panel it throw an error:

undefined method `page' for #<Mongoid::Criteria:0x007f6e74337680>.

I am using rails version : 4.2.7.1 with mongo version '5.0.0'

enter image description here

Upvotes: 2

Views: 2473

Answers (3)

merqlove
merqlove

Reputation: 3784

Simply install kaminari-mongoid.

gem 'kaminari-mongoid'

Upvotes: 12

gwcodes
gwcodes

Reputation: 5690

Are you using the Mongoid fork of ActiveAdmin? Here: https://github.com/elia/activeadmin-mongoid

The error you're getting sounds like a Kaminari paging problem, which this should resolve.

Upvotes: 0

Mark
Mark

Reputation: 6455

Somewhere in your code you're calling the method page on an object that doesn't respond to it.

If you're using sublime text use ctrl + shift + F, then type in '.page'. There will be an entry for where you've misused the method.

Without seeing the actual code / where you're calling the method there isn't a lot else that can be said.

Upvotes: 0

Related Questions