Skip to main content

26 File uploading with ActiveStorage in Rails 5.2

Episode 233 · March 5, 2018

Easily add file uploads to any model (including single or multiple files) using Rails 5.2's new ActiveStorage feature

ActiveStorage File Uploading Rails 5.2


No transcripts available. Earn a free month


Drazen Mokic (160 XP) on
Do previewers for Word Files and Excel 

Konstantinos Stratis (220 XP) on
Great video Chris! You should definitely do another one on ActiveStorage integration with front-end solutions like uppy.js (or a similar one for that matter) which support many user "treats" like image thumbnails prior to uploading etc...

Daniel Chapman (390 XP) on
Yes, I agree that would be great!

Mark (30 XP) on
Looking forward to the direct uploads/trix integration Chris! 

Regarding images attached to another model- 9 times out of 10, I have to include additional meta-data with a file upload (a title, a caption, a photo credit, etc.). Does ActiveStorage make that less of a headache in situations like a Post having multiple uploads (as you have demonstrated in this episode)? Thanks!

Michael (10 XP) on
In case of a has_many_attached setup, how would you go about creating a link to delete an individual file? 

Zulhilmi Zainudin (270 XP) on
Nice one Chris. Question about the `variant` and `preview`. Does the thumbnails will get saved into the disk or they happen on the fly? That's expensive if we do it on the fly, right? Thanks.

Login or create an account to join the conversation.