2

Ember has find() method to issue GET towards the server. You can do it with id or without. I am looking at the official guide and I'm missing something important:

enter image description here

I cannot find the methods which suppose to make my life easier, what are the methods which invoke PUT/POST and DELETE?

I'm using FixtureAdapter, I want to make sure the methods for add/delete and edit, that I'm writing now, will be functional with the RESTAdapter when my server side will be completed.

4

1 回答 1

1

夹具适配器不会对服务器进行任何调用,因此很难看到,但如果您查看重新适配器代码,您可以看到执行 put/post/delete 的调用。

updateRecord:这存在于适配器本身上,实际上您应该在模型上调用 save 并允许 ember 数据自行选择 updateRecord。模型.保存()

createRecord:这应该从类App.KewlKidz.createRecord({id:3, name:"me"}) 中调用;

deleteRecord:在模型上称这个坏男孩。 模型.deleteRecord()

休息适配器

Ember 数据模型

于 2013-07-28T20:32:10.017 回答