Will_paginate and full text search with MongoID

23 views
Skip to first unread message

Martin Stabenfeldt

unread,
Dec 11, 2013, 7:00:27 AM12/11/13
to rubyonra...@googlegroups.com

Hi,

I get undefined method `paginate' for #<Mongoid::Contextual::TextSearch if I try to paginate a full text search.
Using mongoid (4.0.0.alpha1) and will_paginate_mongoid (2.0.1)



@ads = Ad.text_search( params[:q] )
  .paginate(:page => params[:page], :per_page => 10 )


It does however work nice if I don't do a search. E.g.:

Ad.paginate(:page => params[:page])


Any suggestions to how full text search and will paginate can play together?

Cheers,
Martin
Reply all
Reply to author
Forward
0 new messages