RailsCasts Pro episodes are now free!

Learn more or hide this

Duncan Miller's Profile

GitHub User: duncanjmiller

Site: http://www.cammpus.com

Comments by Duncan Miller

Avatar

Adding the stop callback to the paintings.js.coffee file worked for me.

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