【发布时间】:2012-01-16 20:02:44
【问题描述】:
我确实使用 ember-data 与 sinatra json-app 对话实现了一些代码。方法 findAll 按预期工作并加载记录。 此外,我确实在 DS.Store.create 中实现了 updateRecord 方法,但并不真正知道如何更新和提交。请看这里的代码(为简洁起见,我没有包含 jquery 函数):http://pastie.org/3197008
我尝试了以下方法:
a = Todos.records.objectAt(0).set("text", "should be so")
a.store.commit()
但我收到以下错误:TypeError: Object (subclass of DS.State) has no method 'enter'
我应该如何更新记录?还是我忘记为更新实现一些东西?
提前致谢!
【问题讨论】:
标签: ember.js ember-data