Skip to content

Instantly share code, notes, and snippets.

@Linuus
Created August 29, 2014 10:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Linuus/6cb02191a5736c499e0e to your computer and use it in GitHub Desktop.
Save Linuus/6cb02191a5736c499e0e to your computer and use it in GitHub Desktop.
// cards/new.js
import Ember from 'ember';
export default Ember.ObjectController.extend({
needs: ['board'],
board: Ember.computed.alias('controllers.board'),
actions: {
createCard: function() {
var board = this.get('board');
board.get('cards').pushObject(this.get('model')).save().then(function() {
this.transitionToRoute('board', board);
}.bind(this));
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment