Last active
August 29, 2015 13:55
-
-
Save ramontayag/8706321 to your computer and use it in GitHub Desktop.
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
App.Person = DS.Model.extend( | |
name: DS.attr("string") | |
) |
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
App.PersonController = Ember.ObjectController.extend | |
actions: | |
submit: -> | |
console.log "Will save" # This prints | |
onSuccess = (person) -> | |
console.log "Yay saved #{person.get("name")}" | |
onFail = (person) -> | |
console.log "Did not save :(" | |
@get("model").save().then(onSuccess, onFail) | |
console.log "done calling the promise" # This prints | |
# but neither success nor fail come out. Nothing is posted to the server |
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
class App.Store extends DS.Store | |
adapter: '_ams' | |
DS.RESTAdapter.reopen( | |
namespace: 'admin' | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment