Add note about will_paginate previous_page method (#1801)

* Add note about will_paginate previous_page method

Pagination_dict method in JSON adapter section refers only to kaminari prev_page. Newer version of will_paginate uses previous_page method.

* move annotation for will_paginate's previous_page method to inline comment in example methods definition
This commit is contained in:
Francisco Quintero 2016-06-26 22:17:21 -05:00 committed by Benjamin Fleischer
parent d27b21a733
commit e8f0dc787e

View File

@ -81,7 +81,7 @@ def pagination_dict(object)
{
current_page: object.current_page,
next_page: object.next_page,
prev_page: object.prev_page,
prev_page: object.prev_page, # use object.previous_page when using will_paginate
total_pages: object.total_pages,
total_count: object.total_count
}
@ -126,14 +126,13 @@ def meta_attributes(resource, extra_meta = {})
{
current_page: resource.current_page,
next_page: resource.next_page,
prev_page: resource.prev_page,
prev_page: resource.prev_page, # use resource.previous_page when using will_paginate
total_pages: resource.total_pages,
total_count: resource.total_count
}.merge(extra_meta)
end
```
### Attributes adapter
This adapter does not allow us to use `meta` key, due to that it is not possible to add pagination links.