Created
November 10, 2014 01:38
-
-
Save superlou/2b04bfbf864bd386600f to your computer and use it in GitHub Desktop.
Duplicate records
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.ObjectController.extend({ | |
actions: { | |
save: function() { | |
var _this = this; | |
var record = this.store.createRecord('character', this.get('model')); | |
record.save(); | |
// record.save().then(function(character) { | |
// //_this.transitionToRoute('character', character); | |
// }, function() { | |
// record.deleteRecord(); | |
// }); | |
}, | |
cancel: function() { | |
this.transitionToRoute('mystery', this.get('mystery')); | |
} | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
model: function(params) { | |
return { | |
mystery: this.modelFor('mystery') | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment