Taro Singh

Joined

60 Experience
0 Lessons Completed
0 Questions Solved

Activity

Posted in An issue with uploading to S3 with jquery file upload

Hey Adam,
I did find the solution,

Firstly I did not include any stuff for shrines presign plugin. So based off this it would be
Shrine.plugin :presign_endpoint in the Shrine.rb file
then
mount Shrine.presign_endpoint(:cache) => "/YOUR MODEL HERE/upload/cache/presign" in your Routes.rb
then changing

$.getJSON("/YOUR MODEL HERE/upload/cache/presign", options, function(result) {
              console.log("presign", result);
              data.formData = result['fields'];
              data.url = result['url'];
              data.paramName = "file";
              data.submit()
          });

in the uploads.js file

Unless I'm forgetting something that should be the fix, let me know! But now I'm getting an issue where my form only uploads the cache file, never the full image and the form never submits.

Posted in An issue with uploading to S3 with jquery file upload

Hey guys, this is driving me crazy. I'm pretty new to rails and I have been following the shrine & S3 videos using the cloud based ide c9. I got basic direct uploads to work flawlessly, but when I introduced jquery file upload on image attachment, chrome console returns after the add call.
There's probably something I'm not fully understanding here, can anyone guide me in the right direction?

logo Created with Sketch.

Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

© 2020 GoRails, LLC. All rights reserved.