Jquery fileupload with rails carrierwave / s3

I don't know how to load jQuery with plugins / libraries.

I am trying to create an image downloader that uploads images via jquery / ajax on the interface, so I do not need to update the site as the image loads, and then send it to the backend on the carrier wave so that it gets saved in Amazon s3.

I have: Backend: carrier wave + fog for storage on Amazon S3 frontend: jquery - the plugin for downloading files the only thing I found to give me some tips was https://github.com/blueimp/jQuery-File-Upload along with my demo, but I'm not even sure if this is the tutorial repository or also the source code for the library? downloading a file via jquery and using fileupload seems too complicated if jQuery-File-Upload is an example.

On my coffee script this is what I have

initialize: ->
  @render()
  $.log "#{@name}: initialised"
  $('#campaign_main_image').fileupload
  $('#campaign_main_image').fileupload 'option'
    dataType: 'json'
    url: '/api/v3/upload'
    dropZone: $('.campaign-editor-about .dropzone')
    maxFileSize: 5000000
    acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i
    send: (e, data) =>
      $('#logo_wait').show()
    done: (e, data) =>
      @model.set
        logo: data.result.url
      @model.save()

, ( "" ) , ? , ? JQuery ... , jquery? ( )

!

+5

All Articles