Active Storage direct uploads
See original GitHub issueWorking with Active Storage direct uploads when the form is contained by a turbo frame seems not to working as expected.
<turbo-frame ...>
<form ...>
<input type="file" data-direct-upload-url="...">
<input type="submit" ...>
</form>
</turbo-frame>
Turbo intercepts the form submission and doesn’t allow the direct upload run before do the submit request.
But, when a form like this is NOT contained by a turbo-frame tag, it works as expected: the file is uploaded and then the form submitted by turbo.
Is there a workaround or possible solution for this?
Using turbo-rails (0.5.9) by the assets pipeline
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Active Storage Overview - Rails Edge Guides
If you want to use the Direct Upload feature from a JavaScript framework, or you want to integrate custom drag and drop solutions,...
Read more >Understanding Rails ActiveStorage Direct Uploads
It is a storage backend agnostic way to upload files from the user's browser directly into the storage backend, bypassing your application ...
Read more >Direct Uploads with ActiveStorage (Example) - GoRails
Learn how to enable direct uploads in the browser to Amazon S3 or DigitalOcean Spaces using Rails' new ActiveStorage library.
Read more >direct upload using active storage in rails - Stack Overflow
direct upload using active storage in rails - input.dataset.directUploadUrl "undefined" · javascript · ruby-on-rails · ruby · rails-activestorage ...
Read more >activestorage - npm
Direct upload installation · Include activestorage.js in your application's JavaScript bundle. Using the asset pipeline: //= require ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I just tested this and while it seems to work it also appears that the way to setup ActiveStorage in javascript has changed as I’m getting the following error:
Uncaught TypeError: ActiveStorage.start is not a function
Changing my setup to the following seems to do the trick though:
The Rails docs/guides don’t seem to reflect this change yet, so maybe it’s worth me submitting a PR to update the docs?
Thank you for following up on this @CharlieIGG. I’ve opened https://github.com/hotwired/turbo/pull/459 to make the changes mentioned by https://github.com/hotwired/turbo/issues/243#issuecomment-818730045.