1

Hi I am trying to use kaminari as a way to page my collection of 19K results however it doesn't seem to be doing what it is saying on the tin?

I have 19293 documents:

1.9.3p194 :046 >   Content.count
=> 19293

But when I try to get the first page I still get 19293

1.9.3p194 :059 >   Content.page(1).per(50).count
=> 19293 

Any idea what I could be doing wring?

I am using the gem:

14:34:58:myapp(master)$ be gem list kaminari
*** LOCAL GEMS ***
kaminari (0.14.1)

Thanks in advance

charleetm
  • 916
  • 1
  • 12
  • 26

1 Answers1

1

See this issue on the Mongoid Github repo.

To get the correct entries for the page, do:

Content.page(1).per(50).all.to_a

This will evaluate the Mongoid criteria, yielding only 50 entries.

Josh Rieken
  • 2,256
  • 1
  • 19
  • 23