Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

Duncan Miller's Profile

GitHub User: duncanjmiller


Comments by Duncan Miller


Adding the stop callback to the file worked for me.

jQuery ->
    dataType: "script"
    add: (e, data) ->
      file = data.files[0]
      data.context = $(tmpl("template-upload", file))
    progress: (e, data) ->
      if data.context
        progress = parseInt(data.loaded / * 100, 10)
        data.context.find('.bar').css('width', progress + '%')
    stop: (e, data) ->