{"action":"opened","issue":{"url":"https://api.github.com/repos/cerebris/jsonapi-resources/issues/424","labels_url":"https://api.github.com/repos/cerebris/jsonapi-resources/issues/424/labels{/name}","comments_url":"https://api.github.com/repos/cerebris/jsonapi-resources/issues/424/comments","events_url":"https://api.github.com/repos/cerebris/jsonapi-resources/issues/424/events","html_url":"https://github.com/cerebris/jsonapi-resources/issues/424","id":104907259,"number":424,"title":"Nested attributes for relationships","user":{"login":"garytaylor","id":13633,"avatar_url":"https://avatars.githubusercontent.com/u/13633?v=3","gravatar_id":"","url":"https://api.github.com/users/garytaylor","html_url":"https://github.com/garytaylor","followers_url":"https://api.github.com/users/garytaylor/followers","following_url":"https://api.github.com/users/garytaylor/following{/other_user}","gists_url":"https://api.github.com/users/garytaylor/gists{/gist_id}","starred_url":"https://api.github.com/users/garytaylor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garytaylor/subscriptions","organizations_url":"https://api.github.com/users/garytaylor/orgs","repos_url":"https://api.github.com/users/garytaylor/repos","events_url":"https://api.github.com/users/garytaylor/events{/privacy}","received_events_url":"https://api.github.com/users/garytaylor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-04T14:58:46Z","updated_at":"2015-09-04T14:58:46Z","closed_at":null,"body":"If I were updating / creating a \"post\" and I also wanted to create / update tag id 3 in the example below, should that be possible (i.e. similar to nested attributes in active record).\r\n\r\nProbably a bit of a bad example, but hopefully you get the idea ?\r\n\r\nI am finding that each entry in \"data\" in the relationships must only contain id and type.  Nowhere have I yet seen how to do this in json_api in general, not just in this gem so maybe it is not possible.  In which case, I guess I would need to create / update the tag seperately, but then I may need to worry about rolling it back if the creation / update of the post did not succeed etc...  \r\n\r\n\r\n    post '/posts',\r\n      {\r\n        'posts' => {\r\n          'attributes' => {\r\n            'title' => 'A great new Post'\r\n          },\r\n          'relationships' => {\r\n            'tags' => {\r\n              'data' => [\r\n                  {type: 'tags', id: 3, attributes: {name: \"New Tag Name\"}},\r\n                  {type: 'tags', id: 4}\r\n                ]\r\n            }\r\n          }\r\n        }\r\n      }\r\n\r\n    "}}