I’ve allready asked a similar question here (you can look at it to see my code example)
and certainly stackoverflow is a better place to this type of question,
but since I didn’t get any answer (and search many hours on the web) and while my question is about “best practices” may be you could help me there ?
I have 2 models with hasmany and belongTo relationship, and I want to save all the change made in the store to server when user click on a “save” button.
The problem is that when the “parent” model is saved he don’t allready know the ids of his hasmany childs relationship as they are not allready saved, and vis versa.
I saw “store.commit” but it seem to be outdated ?, may be there is an other way to “magicaly” resolve the save “id” problem on server. Otherwise what is the best pratice to do that manualy ?
And to finish, I’m begginer and it is the first time a get so much difficulty to get something to work with Ember, may be there is a lake about this in the official Ember documentation ?
Sorry my bad english, hope my question is still understandable.
I did a try like that : save all childs without ID of the parent, then save parent and then saved again childs to set the parent id,
witch seem to work, but the code look very ugly :
hello guys i’m try to make hasMany related model save in single request on JSON api adapter. but it encounter many problems. in my see request payload is json api formatted. how to solve it?