I am using Ember Data beta2 and I have hasMany installed.
When creating a child entry do I need to use pushObject for the parent matching property?
When viewing the documentation, I get the impression that I need to set the parent property of the record correctly and save it.
Here is how I do it:
addPlugin: function() { //get the value var title = this.get('newPluginName'); if (!title.trim()) { return; } var plugin = { name: title, category: this.get('model'), url: '' }; var plugin = this.store.createRecord('plugin', plugin); plugin.save(); //clear the text field this.set('newPluginName', ''); $("#new-plugin").blur(); }
I see a newly created entry in the Ember inspector in Chrome, it is not dirty, but it is not in the parent listing, and after updating it disappeared.
source share