David Kimura PRO
Joined 7/18/2015
Drifting Ruby Owner
Ruby Rogues Panelist
David Kimura PRO said almost 4 years ago on StimulusJS, Active Storage and DropzoneJS :
Ok, can you post the stimulus controller? It sounds like there is an issue with the data getting back from the direct upload. Can you also console log the blob that is getting returned from Direct Upload?

David Kimura PRO said almost 4 years ago on StimulusJS, Active Storage and DropzoneJS :
Can you console log the blob on upload.create?

David Kimura PRO said almost 4 years ago on StimulusJS, Active Storage and DropzoneJS :
dropzone.on("addedfile", file => {
      setTimeout(() => {
        if (file.accepted) {
          const upload = new DirectUpload(file, this.url)
          upload.create((error, blob) => {
            ########## INSERT HERE #########
            console.log(blob)
            ########## INSERT HERE #########
            this.hiddenInput = document.createElement("input")
            this.hiddenInput.type = "hidden"
            this.hiddenInput.name = this.inputTarget.name
            this.hiddenInput.value = blob.signed_id
            this.inputTarget.parentNode.insertBefore(this.hiddenInput, this.inputTarget.nextSibling)
            dropzone.emit("success", file)
            dropzone.emit("complete", file)
          })
        }
      }, 500)
    })
  }

David Kimura PRO said almost 4 years ago on StimulusJS, Active Storage and DropzoneJS :
Sorry   for not being more clear, it is the Developer Tools Console within your browser.


David Kimura PRO said almost 4 years ago on Autocomplete with StimulusJS :
  can you post relevant code? Also, check your browser's console for any errors as that could prevent controllers from firing. In the initialize() function, you could put a console.log within there to make sure that it is getting triggered. If it isn't, there could be a naming issue or something else. Also, when you register the autocomplete library (likely in the index.js in the controllers folder), make sure you're using that name as the data-controller.