Skip to content

Instantly share code, notes, and snippets.

@mehmetaydogduu
Last active July 20, 2020 17:49
Show Gist options
  • Save mehmetaydogduu/d01424c59d0b70b85035c0d1ae5b97ac to your computer and use it in GitHub Desktop.
Save mehmetaydogduu/d01424c59d0b70b85035c0d1ae5b97ac to your computer and use it in GitHub Desktop.
For using dropzone with rails
Dropzone.autoDiscover = false
new_photo_dropzone = new Dropzone('div#new_photo_dropzone', url: '/file/post')
Dropzone.options.new_photo_dropzone =
paramName: 'file'
maxFilesize: 2
Dropzone.options.myAwesomeDropzone =
init: ->
@on 'processing', (file) ->
@options.url = '/some-other-url'
uploadMultiple: false
paramName: 'file'
thumbnailWidth: 400
thumbnailHeight: 400
thumbnailMethod: 'contain'
resizeWidth: 640
resizeMimeType: 'image/jpeg'
resizeQuality: 0.9
resizeMethod: 'contain'
maxFiles: 1
maxFilesize: 10
acceptedFiles: 'image/*'
autoProcessQueue: false
addRemoveLinks: true
previewsContainer: 'dropzone-container'
.clsbox-1{runat: "server"}
#new_photo_dropzone.dropzone.clsbox
.dropzone-container
.dropzone-previews
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment