I am actually using Ajax instead of Ember-Data to do CRUD operations in my Ember app.
Scenario is whenever I am deleting a record, the model doesn't update. I have a list of projects and each project has a 'Delete' button in front of it.
Here's the action associated with Delete:
deleteItem: function(item){ //function for delete action
var id = item.get('id');
$.ajax({
type : "POST",
url : "http://pioneerdev.us/users/deleteProject/" + id,
dataType : "json",
success : function(data) {
console.log('success');
}
});
alertify.success('Record Deleted!');
window.setTimeout(function(){location.reload()},3000)
}
As you can see I am using location.reload to manually reload the model. If anyone's interested he can look at the full source at my GitHub repo
Is there any better way to do that?