Q-Uploader with Axios and Paperclip



  • I can’t understand how to make this bundle work. When all this worked only on rails, I did not wonder, the pictures just loaded.
    Now I have [ Quasar, Rails, Paperclip gem] .
    I understand correctly that I need to send the path to the picture to the server, but not the file itself? Is the Paperclip using the path itself uploading the image to the server? 🤯
    I have such model

    params.require(:part).permit(..... , partimgs_attributes: [:id, :imgurl, :_destroy])
    

    And my request

    <q-uploader
              url=""
              label="Custom header"
              multiple
              :factory="loadImage"
            />
    
    methods: {
                loadImage(file, updateProgress) {
                    this.$axios.patch('app/books/parts/' + this.id, {part: {partimgs_attributes: file}}).then(resp => {
                        console.log(resp.data)
                    })
                }
    

    Do I need to request this as?

    {part: {partimgs_attributes: {imgurl: file.url}}}
    

Log in to reply