How to apply the will_paginate for an existing issue?

I have a complicated and large sample data with a bunch of different conditions. Model.where(....) in one method found 20 times maybe, but each request needs to work with paging. Yeah, not gut that Model.where as many times occurs, but refactoring is already planned. However, this did not come, would very much like not to write after each Model.where(...) string paginate(:per_page....). Is it possible to do so ".paginate()" to apply to every search or worked with search results? Ie for example, before the respond_with(@books) I can write .paginate ?
July 9th 19 at 13:16

Find more questions by tags Ruby on Rails