# Saving Nested Models With Ember and HATEOAS

**URL:** <https://discuss.emberjs.com/t/saving-nested-models-with-ember-and-hateoas/8810>\
**Category:** Ember Data\
**Created:** [September 21, 2015, 8:56am UTC](https://discuss.emberjs.com/t/saving-nested-models-with-ember-and-hateoas/8810 "2015-09-21T08:56:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anuj\_stonecold](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/anuj_stonecold/32/15822_2.png) [@anuj\_stonecold](https://discuss.emberjs.com/u/anuj_stonecold)\
**Post date:** [September 21, 2015, 8:56am UTC](https://discuss.emberjs.com/t/saving-nested-models-with-ember-and-hateoas/8810/1 "2015-09-21T08:56:53Z")

</div>

How can I achieve something like this `Ember 1.10.0` with Pod structure ? I am using `HATEOAS` with Ember. Both the models are under my pods directory.

So I am able to load the child and parent data from the server with this sample code.

The issue I am seeing is when I try to save using store, it uses the wrong url for saving.

I expect it to use `/api/parentModel/{paren_id}/childModels` but instead it uses `/api/childModel` to save.

```
// uses the server url = /api/parentModel/{id}
// response : 
 {
   links : [
    child : '/api/parentModel/{paren_id}/childModels'
   ] 
 }
export default ParentModel = DS.Model.extend({
      'child' : DS.hasMany('childModel', {async: true})
})

export default ChildModel = DS.Model.extend({
      'someProperty' : DS.attr('string')
})

```
