0

Feel like I'm asking too much Ember questions lately, trust me I'm really trying by myself before every question and hopefully I'll get the whole picture going 'cause as of right now it's been two steps forward, one backwards.

This JSBIN ilustrates what I'm doing. It won't run since I can't load the localadapter_storage library, maybe there's a way to load it into jsbin but if that's so I don't know how to do it.

The problem I have is as follows:

I have the hability to create new posts and to edit old ones. When editing old ones I can't save the changes via this.get('store').save(); (have tried commit() also) since it says Uncaught TypeError: Object [object Object] has no method 'save' The save for the new posts is working properly.

I've compared the issue with other working examples of ember using the local adapter and I've tried to step by step ember.js and ember-data.js but I'm really not that versed yet. According to the error it's like it doesn't know where to apply the .save().

4

1 回答 1

1

它应该是record.save()。保存时不需要访问商店,所以在你的情况下,它会是这样的,this.get('controller.model').save();

于 2013-11-12T02:20:58.253 回答