Set custom total_pages value
Halvanhelv opened this issue · 1 comments
Halvanhelv commented
Hi, I take the total number of pages from the external api, how to use these values for pagination, because I have an undefined method total_pages
error
mislav commented
You can pass :total_entries
to the paginate()
method on the model:
MyMode.paginate(page: 1, per_page: 10, total_entries: 50) #=> total_pages will now be 5