Mongoid pagination
问题 I tried @posts = Post.page(params[:page]).per_page(10) and @posts = Post.paginate(:page => 1, :per_page => 10) but neither method works undefined method `page' for Post:Class undefined method `paginate' for Post:Class How do you do pagination with mongoid? 回答1: You should use Kaminari https://github.com/amatsuda/kaminari 回答2: This works fine for me: @posts = Post.paginate(:page => 1, :limit => 10).desc(:_id) desc(:_id) is added so that latest posts could be listed first. 回答3: Still using will