Active Storage For Image Uploads | Ruby On Rails 7 Tutorial

Sdílet
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

Komentáře • 44

  • @Deanin
    @Deanin  Před 2 lety +8

    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. :)

  • @yahyaelganayni4055
    @yahyaelganayni4055 Před rokem +7

    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.

    • @Deanin
      @Deanin  Před rokem +1

      Happy to help! If there's anything else I can cover, feel free to ask.

  • @mikaelotti
    @mikaelotti Před rokem +3

    This is really good! Love the structure, pace... and font size. THANK YOU!

    • @Deanin
      @Deanin  Před rokem

      Hahaha, first time I've heard positive things about the font size! Glad it was helpful! 🙂

  • @tiagorahal5135
    @tiagorahal5135 Před 2 lety +2

    Thank you a lot man! I'm having a challenge to get a job as a junior rails dev and this video saved me

  • @bienvenupam2584
    @bienvenupam2584 Před 2 lety +2

    Thank you Deanin ...

  • @beacoder
    @beacoder Před 2 lety +3

    this is amazing. your videos have been absolute gold for me! thanks dean

    • @Deanin
      @Deanin  Před 2 lety +1

      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. 😤

    • @beacoder
      @beacoder Před 2 lety +1

      @@Deanin I'd be interested in knowing how private keys / data are normally stored in rails!

    • @Deanin
      @Deanin  Před 2 lety +1

      Sounds good, I'll add it to the list!

  • @Povai
    @Povai Před rokem +1

    Man thanks so much for this video Loved it!

  • @kamerberattopal1358
    @kamerberattopal1358 Před 2 lety +1

    Very informative, great video. Thank you so much sir.

  • @NoobCodeSaga
    @NoobCodeSaga Před rokem +1

    Thanks, man, you helped me so much!

  • @ledockol
    @ledockol Před 2 lety +1

    GOOD VIDEO. THANKS!

  • @RitchieMatos
    @RitchieMatos Před rokem

    Thanks for the great video. Just wondering what extensions you're using for you VSCode

  • @abdouazizseck8838
    @abdouazizseck8838 Před 2 lety +2

    Thanks 👍😊

  • @OscarDiaz-mt9uq
    @OscarDiaz-mt9uq Před rokem

    very good video :) one question is there any way to add a watermark to the images when they are displayed?

  • @tkhobbes
    @tkhobbes Před 2 lety

    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.

  • @MatthewTrussell
    @MatthewTrussell Před rokem +1

    I believe that if you run action_text:install it will also install active_storage, as it seems like it's a dependent package.

  • @patrickfeeney4180
    @patrickfeeney4180 Před 5 měsíci

    Thanks

  • @marcbentoy
    @marcbentoy Před rokem

    Thanks for this awesome video. Can you please help me do some rspec test on this?

  • @JamesOh-nn9oi
    @JamesOh-nn9oi Před rokem

    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?

  • @MrHorse16
    @MrHorse16 Před rokem

    How would you recommend parsing a file uploaded to Active Storage?

  • @dbelyaev
    @dbelyaev Před 2 lety

    Is there any way to get more cleaner image url in ActiveStorage?

  • @ThePazuzu
    @ThePazuzu Před rokem

    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.

  • @Pelu6cuerdas
    @Pelu6cuerdas Před rokem

    Nice video! But in my case multiple: true is not working. I can only upload one image, do you know why?

  • @haroldpepete
    @haroldpepete Před rokem

    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

  • @anthonyferrer1034
    @anthonyferrer1034 Před 9 měsíci

    Does this also work in prod environment?

  • @jesusmiranda9620
    @jesusmiranda9620 Před 2 lety +1

    Any tips or recommendations for documentation to use to host the images on S3?

    • @Deanin
      @Deanin  Před 2 lety +2

      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

    • @jesusmiranda9620
      @jesusmiranda9620 Před 2 lety +1

      @@Deanin Thank you so much!

    • @Deanin
      @Deanin  Před 2 lety

      Happy to help :)

  • @rodrigocalle98
    @rodrigocalle98 Před rokem

    How I can attach images to an API in Rails from Postman?

  • @414odysseybmx
    @414odysseybmx Před rokem

    cannot resize or access attachments in ActionText outside of the show?

  • @Sediqwe
    @Sediqwe Před 2 lety

    Multi image upload -> single image save?

  • @dp2586
    @dp2586 Před 9 měsíci +1

    how to convert image input by user into webp format ? help mee @Deanin

    • @Deanin
      @Deanin  Před 9 měsíci

      Hey there, saw this comment a few days ago and finally got around to it. Hope this helps!
      czcams.com/video/b4nc9VVuO78/video.html

  • @Povai
    @Povai Před 2 lety +1

    Video idea how to filter through models depending on the filters set

    • @Deanin
      @Deanin  Před 2 lety

      Added it to the list!

  • @abdouazizseck8838
    @abdouazizseck8838 Před 2 lety +2

    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

    • @Deanin
      @Deanin  Před 2 lety +1

      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

    • @abdouazizseck8838
      @abdouazizseck8838 Před 2 lety +1

      @@Deanin oh really thanks it's a paradise ticket

  • @karl2071
    @karl2071 Před rokem

    10:58