Skip to content

Commit

Permalink
Merge pull request emberjs#803 from benoittgt/master
Browse files Browse the repository at this point in the history
Missing json payload for EmbeddedRecordsMixin
  • Loading branch information
locks committed Sep 25, 2015
2 parents d210de0 + 844cdb4 commit 85940cb
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion source/models/customizing-serializers.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,24 @@ To set up embedded records, include the mixin when extending a
serializer then define and configure embedded relationships.

For example if your `post` model contained an embedded `author` record
you would define your relationship like this:
that looks similar to this:


```json
{
"id": 1,
"title": "Rails is omakase",
"tag": "rails",
"authors": [
{
"id": 2,
"name": "Steve"
}
]
}
```

You would define your relationship like this:

```app/serializers/post.js
export default DS.JSONSerializer.extend(DS.EmbeddedRecordsMixin, {
Expand Down

0 comments on commit 85940cb

Please sign in to comment.