From 844cdb45bee32c935715f599c8ce55f5febab8fa Mon Sep 17 00:00:00 2001 From: Benoit Tigeot Date: Fri, 25 Sep 2015 09:48:31 +0200 Subject: [PATCH] Missing json payload for EmbeddedRecordsMixin Initial discussion : https://github.com/emberjs/guides/issues/791 --- source/models/customizing-serializers.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/source/models/customizing-serializers.md b/source/models/customizing-serializers.md index 7b2d75324..55af2b469 100644 --- a/source/models/customizing-serializers.md +++ b/source/models/customizing-serializers.md @@ -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, {