links doc
This commit is contained in:
parent
ecd7bbc793
commit
1e6d127aec
10
README.md
10
README.md
@ -211,6 +211,11 @@ Support for top-level included member through ` options[:include] `.
|
||||
```ruby
|
||||
options = {}
|
||||
options[:meta] = { total: 2 }
|
||||
options[:links] = {
|
||||
self: '...',
|
||||
next: '...',
|
||||
prev: '...'
|
||||
}
|
||||
options[:include] = [:actors]
|
||||
MovieSerializer.new([movie, movie], options).serialized_json
|
||||
```
|
||||
@ -219,6 +224,11 @@ MovieSerializer.new([movie, movie], options).serialized_json
|
||||
|
||||
```ruby
|
||||
options[:meta] = { total: 2 }
|
||||
options[:links] = {
|
||||
self: '...',
|
||||
next: '...',
|
||||
prev: '...'
|
||||
}
|
||||
hash = MovieSerializer.new([movie, movie], options).serializable_hash
|
||||
json_string = MovieSerializer.new([movie, movie], options).serialized_json
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user