Skip to content

Instantly share code, notes, and snippets.

@raedatoui
Last active December 17, 2015 23:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raedatoui/5690717 to your computer and use it in GitHub Desktop.
Save raedatoui/5690717 to your computer and use it in GitHub Desktop.
Spine file upload
@form.ajaxForm
dataType: 'json'
beforeSend: =>
# ui treatement
uploadProgress: (event, position, total, percentComplete) =>
# progress ui
complete: (xhr) =>
# fetch model based on id
attr = JSON.parse xhr.responseText
App.Layer.url = "/layers/#{attr.id}"
App.Layer.one "refresh", (data) =>
App.Layer.url = "/layers"
App.Layer.fetch()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment