Skip to content

Instantly share code, notes, and snippets.

@detournemint
Created January 31, 2015 00:32
Show Gist options
  • Save detournemint/fbc75d110bc9948ab802 to your computer and use it in GitHub Desktop.
Save detournemint/fbc75d110bc9948ab802 to your computer and use it in GitHub Desktop.
Ajax call to set a model attribute in coffeescript from ember.js
$.ajax
url: "http://10.0.0.75:8080/packages/" +model.get('id')+"/apk/analytics/selectors"
headers:
Authorization: 'Basic ' + Cookies.utils.readCookie('spch')
success: (response) ->
model.set("selectors", $.map response.selectors, (val) -> val['selector_type'])
error: () ->
console.log "error"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment