You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/howto/add_pagination_links.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,13 +77,13 @@ If you are using `JSON` adapter, pagination links will not be included automatic
77
77
Add this method to your base API controller.
78
78
79
79
```ruby
80
-
defpagination_dict(object)
80
+
defpagination_dict(collection)
81
81
{
82
-
current_page:object.current_page,
83
-
next_page:object.next_page,
84
-
prev_page:object.prev_page, # use object.previous_page when using will_paginate
85
-
total_pages:object.total_pages,
86
-
total_count:object.total_count
82
+
current_page:collection.current_page,
83
+
next_page:collection.next_page,
84
+
prev_page:collection.prev_page, # use collection.previous_page when using will_paginate
85
+
total_pages:collection.total_pages,
86
+
total_count:collection.total_count
87
87
}
88
88
end
89
89
```
@@ -117,18 +117,18 @@ ex.
117
117
You can also achieve the same result if you have a helper method that adds the pagination info in the meta tag. For instance, in your action specify a custom serializer.
0 commit comments