Last active
December 18, 2015 13:09
-
-
Save ramontayag/5788003 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
App.ScoutsNewController = Ember.ObjectController.extend | |
submit: -> | |
model = @get('model') | |
model.on 'didCreate', -> | |
console.log 'CREATED' # I want to redirect to the index after creation | |
model.save() |
This file contains hidden or 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
App.ScoutsNewRoute = Ember.Route.extend | |
model: -> | |
App.Scout.createRecord() | |
events: | |
submit: -> | |
# Based on what I've read, the right place to put the code you see in the controller is here. How do I get access to the model? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment