Last active
July 20, 2020 17:49
-
-
Save mehmetaydogduu/d01424c59d0b70b85035c0d1ae5b97ac to your computer and use it in GitHub Desktop.
For using dropzone with rails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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