Skip to content

Instantly share code, notes, and snippets.

@ramontayag
Last active August 29, 2015 13:55
Show Gist options
  • Save ramontayag/8706321 to your computer and use it in GitHub Desktop.
Save ramontayag/8706321 to your computer and use it in GitHub Desktop.
App.Person = DS.Model.extend(
name: DS.attr("string")
)
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
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