[DOCS] Refactor, update, create documentation [ci skip]

This commit is contained in:
Benjamin Fleischer
2015-12-10 15:12:06 -06:00
parent 1301b52696
commit ce17a1b305
26 changed files with 740 additions and 485 deletions

View File

@@ -1,3 +1,5 @@
[Back to Guides](../README.md)
# How to add pagination links
### JSON API adapter
@@ -8,6 +10,10 @@ the resource is paginated and if you are using the ```JsonApi``` adapter.
If you want pagination links in your response, use [Kaminari](https://github.com/amatsuda/kaminari)
or [WillPaginate](https://github.com/mislav/will_paginate).
Although the others adapters does not have this feature, it is possible to
implement pagination links to `JSON` adapter. For more information about it,
please see in our docs
###### Kaminari examples
```ruby
@@ -33,7 +39,7 @@ render json: @posts
```
```ruby
ActiveModel::Serializer.config.adapter = :json_api
ActiveModelSerializers.config.adapter = :json_api
```
ex:
@@ -61,7 +67,7 @@ ex:
}
```
AMS pagination relies on a paginated collection with the methods `current_page`, `total_pages`, and `size`, such as are supported by both [Kaminari](https://github.com/amatsuda/kaminari) or [WillPaginate](https://github.com/mislav/will_paginate).
ActiveModelSerializers pagination relies on a paginated collection with the methods `current_page`, `total_pages`, and `size`, such as are supported by both [Kaminari](https://github.com/amatsuda/kaminari) or [WillPaginate](https://github.com/mislav/will_paginate).
### JSON adapter