Hi,
I'm struggling to paginate using mongoid. I'm able to call paginate on my collection object like
@results = @collections.paginate :page => 1, :per_page => 10
but how it needs to be referred in view?
In my view I have rendered the collection in partial as <%= render :collection => @collections, :partial => collect.xml %> <%= will_paginate @results %>
In the above line I get the error undefined method total_pages for array.
But there is no error if I remove the will_paginate call in view and all the collections are shown in the view without pagination. Pls help.
I think I'm going wrong in calling the pagination helper in view. I have searched for quite a long time and did not find an example that included the pagination call in view for mongoid.
Forgive me if it is a dumb question. I'm new to mongoid.