Ruby on Rails Drag and Drop Uploads with Active Storage, Stimulus.js and Dropzone.js

  Рет қаралды 14,572

webcrunch

webcrunch

Күн бұрын

Пікірлер: 33
@marcosfilho7016
@marcosfilho7016 4 жыл бұрын
Dude, your content rocks! Found out about you and this video on Dev.to and I can't believe you don't have a thousands likes on this alone. Please keep going, you just got a fan.
@Webcrunch
@Webcrunch 4 жыл бұрын
Appreciate the support and kind words!
@IvanRaszl
@IvanRaszl 4 жыл бұрын
Thank you so much for the great tutorial. What if I wanted multiple drop zones in a single form. For example a dropzone for a video, and another one for a cover image? How would the javascript have to change for least amount of code duplication?
@yairfacio6499
@yairfacio6499 4 жыл бұрын
Thank you it's a great video. Could you make another video explaining how to install tailwindcss from scratch? Thanks
@aleksandrbalakiriev447
@aleksandrbalakiriev447 5 жыл бұрын
Thanks, very useful!! Do you plan to finish with edit images by updating post? it will be awesome
@Webcrunch
@Webcrunch 5 жыл бұрын
You should be able to update the post but have to drag and drop a new image in. Displaying attachments there is quite a challenge but maybe I can find a way to get it to work in the future.
@jessicasciani9250
@jessicasciani9250 4 жыл бұрын
Hello! Small question, are you able to choose pictures order with this tutorial? Just wanted to be sure before following it! Thanks a lot for taking the time to make this video :)
@Webcrunch
@Webcrunch 4 жыл бұрын
Hey Jessica, So this tutorial assumes you would only attach a single image at a time. Multiple images while possible would need some more engineering to orchestrate.
@time4anew1
@time4anew1 4 жыл бұрын
Something to add: disable submit button before uploading - add $(":submit").prop("disabled", true); to the connect() method, and $(":submit").prop("disabled", false); to this.dropZone on added file.
@aachaltayade8685
@aachaltayade8685 3 жыл бұрын
Hi, edit form not populate uploaded image. Can you please help
@MajaProkic
@MajaProkic Жыл бұрын
Sorry, I have one small (I think) problem. When I drag and drop my photo, it successfully works, but in my console I have message No template found for ActiveStorage::DiskController#update, rendering head :no_content, can someone help me?
@gagnedan2k
@gagnedan2k 5 жыл бұрын
Hi ! You change your song intro ! Do you composed them ? The previous one was heavier 🤷‍♂️ which I prefer 😀 That said, it is always a pleasure to watch your tutorial, keep your good works !!!
@AndyLeverenzJustalever
@AndyLeverenzJustalever 5 жыл бұрын
I mix them up sometimes :) i made this one too.
@brentgreeff1115
@brentgreeff1115 5 жыл бұрын
Hate to be that guy, but the last thing I need at 2am when looking for something code-related on youtube is to feel like I have a teenage son who didnt get a new Xbox. Just consider the mood of the actual video VS the intro? Also consider that people might have the volume cranked. Just saying.
@Webcrunch
@Webcrunch 5 жыл бұрын
I don't mean to argue but maybe you're the edge case? The intros are tiny bits of branding I add to these free tutorials. I also can't control your volume...
@sandhyamahesh3082
@sandhyamahesh3082 3 жыл бұрын
Can I know is it possible to upload multiple files with few changes as suggested in active storage instead has_one_attached and in the controller declaring array. whether it works with your code.? Anyway thank your for your wonderful tutorial..
@Webcrunch
@Webcrunch 3 жыл бұрын
I haven't tried it with this same approach but active storage has another method that allows multiple uploads "has_many_attached :some_name". The JavaScript side of this would need an audit to accommodate but I know Dropzone.js should definitely allow for multiple uploads.
@ervinismu6265
@ervinismu6265 4 жыл бұрын
big thanks
@jl789nz
@jl789nz 2 жыл бұрын
Has anyone found a way to manage images like Airbnb does? I'm searching for a way to upload, edit, sort and delete images? I would have thought that this would be a super common problem that people would have solved, but I've never found a tutorial that comes close to doing something like this.
@Webcrunch
@Webcrunch 2 жыл бұрын
I'd say their approach is very custom. You can get pretty close with ActiveStorage now in Rails but it would require significant investment on the front end to make things as nice as Airbnb.
@jl789nz
@jl789nz 2 жыл бұрын
@@Webcrunch Does seem to be the case. I've got a project I'm working on at the moment that I would love to have this functionality. I've got all the backend stuff sorted out, but I'm not even sure on where to start on solving the front end side of things. This looks like a good start though. Also, thanks for all you work with these tutorials. I really appreciate them.
@CHAPEAUDEPAILLE24
@CHAPEAUDEPAILLE24 5 жыл бұрын
So good brow!!!!
@MirrorCommunications
@MirrorCommunications 5 жыл бұрын
Nice!
@Teekay400
@Teekay400 5 жыл бұрын
How do I contact you?
@AndyLeverenzJustalever
@AndyLeverenzJustalever 5 жыл бұрын
Check the about section of my channel.
@beinlive.online4413
@beinlive.online4413 5 жыл бұрын
github link dosnt work
@Webcrunch
@Webcrunch 5 жыл бұрын
Should work now! Sorry about that
@beinlive.online4413
@beinlive.online4413 5 жыл бұрын
@@Webcrunch thanks for the very helpfull content
@PhilSmy
@PhilSmy 5 жыл бұрын
Looks good, but it's a shame it depends on Stimulus!
@phonk64
@phonk64 Жыл бұрын
Neither Rails nor Dropzone *depend* on Stimulus. You do not have to implement it this way. This is *far far* too complex, IMHO.
How To Use GraphQL with Ruby on Rails  - Part 1 - Backend
36:35
Some Of My Favorite Ruby Gems
29:04
webcrunch
Рет қаралды 5 М.
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН
Understanding the Asset Pipeline in Ruby on Rails
34:30
webcrunch
Рет қаралды 10 М.
Alpha preview: Modern JavaScript in Rails 7 without Webpack
27:06
David Heinemeier Hansson
Рет қаралды 61 М.
A Tour of Stimulus.js
25:34
webcrunch
Рет қаралды 10 М.
Should you use Ruby on Rails in 2024?
14:43
webcrunch
Рет қаралды 58 М.
Understanding Ruby on Rails Active Record Migrations
27:30
webcrunch
Рет қаралды 20 М.
Rails 5.2 ActiveStorage Introduction
20:55
GoRails
Рет қаралды 22 М.
Ruby on Rails Routing - Part 1
25:13
webcrunch
Рет қаралды 9 М.
Drag and Drop Sortable Lists in Ruby on Rails
13:14
GoRails
Рет қаралды 17 М.
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН