administrate icon indicating copy to clipboard operation
administrate copied to clipboard

undefined method

Open Sajonara opened this issue 11 years ago • 3 comments

I have installed administrate on a system with ruby 2.2.3 and rails 4.2.5. I am using devise and will_paginate as gems but when I try to open the admin panel the webserver replys with a "NoMethodError".

undefined method `per' for #<ActiveRecord::Relation []>

Sajonara avatar Nov 14 '15 13:11 Sajonara

I've seen this issue before (coincidentally using rails_admin). Administrate uses kaminari, and will_paginate and kaminari don't play well together yet it seems. What I did in my project was just switch to kaminari for pagination as a fast solution. If you want to stick with will_paginate, this might help, and there are several conversations addressing this on the will_paginate and kaminari repos.

picandocodigo avatar Nov 14 '15 15:11 picandocodigo

@picandocodigo Thx a lot. As it's a new project I still can decide to switch and as you told told me kaminari won't inflict I implemented this gem instead and now everything seems fine. Thank you.

Sajonara avatar Nov 14 '15 17:11 Sajonara

@Sajonara glad it worked out! For reference, this issue also came up in #158.

It sounds like you're good, so I'm going to close this. Feel free to re-open if you have other questions.

c-lliope avatar Nov 15 '15 02:11 c-lliope