Skip to content

Instantly share code, notes, and snippets.

@ramontayag
Last active December 18, 2015 13:09
Show Gist options
  • Save ramontayag/5788003 to your computer and use it in GitHub Desktop.
Save ramontayag/5788003 to your computer and use it in GitHub Desktop.
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()
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