Answer the question
In order to leave comments, you need to log in
How to apply will_paginate to an existing SERP?
I have a complex and large dataset with a bunch of different conditions. Model.where(....) in one method occurs probably 20 times, but each such request must work with paging. Yes, it’s not gut that Model.where occurs so many times, but refactorings are already planned. However, until it comes, I would really like not to write the paginate(:per_page....) line after each Model.where(...). Is there any way to make ".paginate()" apply to every search or work with search results? Those. for example, so that before respond_with(@books) I can safely write .paginate ?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question