Active Storage For Image Uploads | Ruby On Rails 7 Tutorial
Vložit
- čas přidán 26. 04. 2024
- This video covers uploading single and multiple images, resizing them, and validating them. It shows you how to use Vips and Mini Magick with the Image Processing Gem and how to install ImageMagick. It also covers how attachments work in Action Text.
This is a refresh of my previous video "Active Storage For Image Uploads | Ruby on Rails 5.2 Tutorial" but done in Rails 7.
Join this channel to help support these videos:
/ @deanin
Follow me on social media:
linktr.ee/deanin
Join this channel to get access to perks:
/ @deanin
If you liked this video, please consider subscribing: t.co/RZ4EwP0F2a
Timestamps
0:00 What Changed Since Rails 5.2?
0:41 Installing And Configuring Active Storage And Action Text
1:56 Change Active Storage To Use Mini Magick Instead of Vips In Rails 7
2:21 Install ImageMagick and LibVips Dependencies For Active Storage and Action Text
2:40 The Active Storage Images Model
3:22 The Active Storage Images Controller
3:53 The Active Storage Images Views
8:16 Action Text's Active Storage Blob Location
8:55 Resizing Single and Multiple Images With Active Storage
13:38 Validating Image Uploads With Active Storage In Rails 7
#Deanin #Software #Programming
Currently working on multiple new video ideas, as well as some courses. I've soft launched a course platform on my website learn.deanin.com
It's not done yet, but let me know if there's any courses you'd be interested in. :)
I can not thank you enough for what you are doing not a lot of CZcamsrs explain rails every one trying to have a trendy video so they explain react most of the time but thanks to you I have a good understanding of rails again thank you very much.
Happy to help! If there's anything else I can cover, feel free to ask.
This is really good! Love the structure, pace... and font size. THANK YOU!
Hahaha, first time I've heard positive things about the font size! Glad it was helpful! 🙂
Thank you a lot man! I'm having a challenge to get a job as a junior rails dev and this video saved me
Thank you Deanin ...
this is amazing. your videos have been absolute gold for me! thanks dean
Thank you so much! I'm glad they've been helpful. If there's anything I'm not covering that might be helpful feel free to reach out and I'll try my best to cover it. 😤
@@Deanin I'd be interested in knowing how private keys / data are normally stored in rails!
Sounds good, I'll add it to the list!
Man thanks so much for this video Loved it!
Very informative, great video. Thank you so much sir.
Thanks, man, you helped me so much!
GOOD VIDEO. THANKS!
Thanks for the great video. Just wondering what extensions you're using for you VSCode
Thanks 👍😊
very good video :) one question is there any way to add a watermark to the images when they are displayed?
Thanks, love the video! The only thing I cannot find anywhere is how to remove an image (without replacement, ie not uploading a new one, but completely remove), in a way that allows a new picture to be uploaded later.
I believe that if you run action_text:install it will also install active_storage, as it seems like it's a dependent package.
Thanks
Thanks for this awesome video. Can you please help me do some rspec test on this?
Thank you so much for the video! One quick question, even though I followed the set up in the video, for some reason my page get stuck when I am uploading new images or visit pages that display images. It sometimes work, but when I see the terminal it is stuck on "ActiveStorage::AnalyzeJob" and the page is loading forever. Do you have any idea what is causing this issue?
How would you recommend parsing a file uploaded to Active Storage?
Is there any way to get more cleaner image url in ActiveStorage?
Is there a way to customize the image url? They're all like host:port/rails/active_storage/disk/file. I would like to replace the /rails/active_storage/disk for something like year/month/day/file like wordpress.
Nice video! But in my case multiple: true is not working. I can only upload one image, do you know why?
how can i access an image in falied form? i mean, when your model is not valid because of some validations fail but you want to retrieve that image to the view to customer doesn't have to choose the image again, and customer can fill the other field and send the form again to the backend, and repeat this cycle until the form is valid and all the information can be save
Does this also work in prod environment?
Any tips or recommendations for documentation to use to host the images on S3?
Off the top of my head, I know that the edge guide has a decent guide for S3.
I used that same S3 config the other day when I hosted an app on Heroku that needed active storage, so I used a DigitalOcean Space with it.
Here's links to the edge guide:
edgeguides.rubyonrails.org/active_storage_overview.html#s3-service-amazon-s3-and-s3-compatible-apis
The video using S3:
czcams.com/video/d2-cd4RKFwA/video.html
@@Deanin Thank you so much!
Happy to help :)
How I can attach images to an API in Rails from Postman?
cannot resize or access attachments in ActionText outside of the show?
Multi image upload -> single image save?
how to convert image input by user into webp format ? help mee @Deanin
Hey there, saw this comment a few days ago and finally got around to it. Hope this helps!
czcams.com/video/b4nc9VVuO78/video.html
Video idea how to filter through models depending on the filters set
Added it to the list!
Please can you make a video with Rails 7 how to get JS code read.
Because I have written a JS code in rails 5 that works fine but nothing in rails 7
Yes, they changed how it works in 7. I can cover this, but for now you might want to look at either using Stimulus, or look for an "Import Map" tutorial. That might help you figure out how to get started.
I've also created a beginner Rails 7 tutorial series that covers creating comments recently. The "Edit Comment" video uses stimulus JS. That could also be good to watch to see how JS works now.
Link to stimulus video: czcams.com/video/A4cDwj0JYVo/video.html
@@Deanin oh really thanks it's a paradise ticket
10:58