Hi All-
I’d like to remove a relation in ember data. I have two models, wishlists and colleges.
App.Wishlist = DS.Model.extend({
colleges: DS.hasMany('college'),
grade: DS.attr('string')
});
And an action that should remove the college from the wishlist (but keep the college) and then reload the page.
removeCollegeFromWishlist: function(college){
var wishlist = this.get('model').content[0];
wishlist.get('colleges').removeObject(this.store.get('colleges',college.id));
wishlist.save().then(function (){
this.transitionToRoute('student.wishlist');
});
},
However, the PUT request generate by this still contains all of the ids that were in the original load, ie, it does not delete the relationship.