will_paginate with named_scopes

后端 未结 4 2010
野趣味
野趣味 2021-02-02 14:56

I\'m using will_paginate for pagination, which has been working well so far, except for this one thing.

If I try to paginate a scope, for instance

class          


        
4条回答
  •  Happy的楠姐
    2021-02-02 15:16

    Kind of a weird solution, but

    User.scope.find(:all).paginate :page => params[:page], :per_page => 10
    

    works?

提交回复
热议问题