Created
June 4, 2015 00:33
-
-
Save shenst1/198250dd5012feec8cb5 to your computer and use it in GitHub Desktop.
create
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
xport default Ember.Controller.extend({ | |
needs: ['organization'], | |
actions: { | |
create: function() { | |
var title = this.get('title'); | |
var organization = this.get('controllers.organization'); | |
var dataset = this.store.createRecord('dataset', { | |
title: title | |
}); | |
this.set('title', ''); | |
dataset.save(); | |
organization.get('model.datasets').addObject(dataset); | |
this.transitionToRoute('dataset', dataset); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment