# Save on a model with Ember-data returns error

**URL:** <https://discuss.emberjs.com/t/save-on-a-model-with-ember-data-returns-error/4241>\
**Category:** Ember Data\
**Created:** [February 23, 2014, 1:32am UTC](https://discuss.emberjs.com/t/save-on-a-model-with-ember-data-returns-error/4241 "2014-02-23T01:32:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mgenev](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/mgenev/32/5208_2.png) [@mgenev](https://discuss.emberjs.com/u/mgenev)\
**Post date:** [February 23, 2014, 1:32am UTC](https://discuss.emberjs.com/t/save-on-a-model-with-ember-data-returns-error/4241/1 "2014-02-23T01:32:48Z")

</div>

when I save, a post request happens, my server creates the record, then returns the new record with an id, but ember gives me this error:

No model was found for '\_id

Any idea why?

My json looks like this:

{ “\_id”: “53094e7e502b5a6828000011”, “content”: “fx”, “title”: “fx”, “created”: “2014-02-23T01:27:26.238Z” }

---

<div class="post-metadata">

**Author:** ![mgenev](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/mgenev/32/5208_2.png) [@mgenev](https://discuss.emberjs.com/u/mgenev)\
**Post date:** [February 23, 2014, 1:46am UTC](https://discuss.emberjs.com/t/save-on-a-model-with-ember-data-returns-error/4241/2 "2014-02-23T01:46:23Z")

</div>

apparently it’s because it wants the json from the server to be its own way and to be wrapped in article { }.

But even with that, when I try to do what the persisting records part of the guide says here:

```
var post = store.createRecord('post', {
  title: 'Rails is Omakase',
  body: 'Lorem ipsum'
});

var self = this;

function transitionToPost(post) {
  self.transitionToRoute('posts.show', post);
}

function failure(reason) {
  // handle the error
}

post.save().then(transitionToPost).catch(failure);

// => POST to '/posts'
// => transitioning to posts.show route

```

it doesn’t work, it returns a useless object, supposedly a promise, but no data is contained which I can pass on to my other route like the demo ☹

my code is here:

[https://github.com/mgenev/Full-Stack-JS-Boilerplate/blob/master/public/ember/controllers/articles\_controller.js](https://github.com/mgenev/Full-Stack-JS-Boilerplate/blob/master/public/ember/controllers/articles_controller.js)

---

<div class="post-metadata">

**Author:** ![midd](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/midd/32/196_2.png) [@midd](https://discuss.emberjs.com/u/midd)\
**Post date:** [February 23, 2014, 1:17pm UTC](https://discuss.emberjs.com/t/save-on-a-model-with-ember-data-returns-error/4241/3 "2014-02-23T13:17:03Z")

</div>

Wrap your object programmatically:

```
App.ArticleSerializer = DS.RESTSerializer.extend({
  extractSingle: function(store, type, payload, id, requestType) {
    payload = { article: payload };
    return this._super(store, type, payload, id, requestType);
  },
});

```

---

<div class="post-metadata">

**Author:** ![mgenev](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/mgenev/32/5208_2.png) [@mgenev](https://discuss.emberjs.com/u/mgenev)\
**Post date:** [February 23, 2014, 10:17pm UTC](https://discuss.emberjs.com/t/save-on-a-model-with-ember-data-returns-error/4241/4 "2014-02-23T22:17:57Z")

</div>

thank you, can you please tell me where the documentation is for this?
