Skip to content

Commit bffae62

Browse files
authored
Update README.md
1 parent a6b08bf commit bffae62

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,12 @@ class ResourceInterface
5454
# relationships, or nil.
5555
# @return [Hash]
5656
def as_jsonapi(options = {}); end
57+
end
5758
```
5859
5960
#### Rendering a single resource
6061
```ruby
61-
JSONAPI.render(resource,
62+
JSONAPI.render(data: resource,
6263
include: include_string,
6364
fields: fields_hash,
6465
meta: meta_hash,
@@ -69,7 +70,7 @@ This returns a JSON API compliant hash representing the described document.
6970
7071
#### Rendering a collection of resources
7172
```ruby
72-
JSONAPI.render(resources,
73+
JSONAPI.render(data: resources,
7374
include: include_string,
7475
fields: fields_hash,
7576
meta: meta_hash,
@@ -81,7 +82,7 @@ This returns a JSON API compliant hash representing the described document.
8182
### Rendering errors
8283

8384
```ruby
84-
JSONAPI.render_errors(errors,
85+
JSONAPI.render_errors(errors: errors,
8586
meta: meta_hash,
8687
links: links_hash)
8788
```

0 commit comments

Comments
 (0)