Closed Halvanhelv closed 3 years ago
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
total_pages
You can pass :total_entries to the paginate() method on the model:
:total_entries
paginate()
MyMode.paginate(page: 1, per_page: 10, total_entries: 50) #=> total_pages will now be 5
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