Sha256: bdb43b79567e27a1a21e2b745d2448ab3a86e046ebffa5cb86ec30102fe95150
Contents?: true
Size: 608 Bytes
Versions: 6
Compression:
Stored size: 608 Bytes
Contents
export default Ember.Route.extend({ model: function() { return this.store.createRecord('<%= file_name.singularize -%>'); }, deactivate: function() { var model = this.get('controller.model'); if (model.get('isNew')) { model.deleteRecord(); } }, actions: { save: function() { var model = this.get('controller.model'); var _this = this; model.save().then(function() { _this.transitionTo('<%= file_name.pluralize -%>.show', model); }); }, cancel: function() { this.transitionTo('<%= file_name.pluralize -%>.index'); } } });
Version data entries
6 entries across 6 versions & 1 rubygems