Ruby on Rails #21 Active Storage With Amazon S3 Cloud Storage

aws s3 for file storage:
github.com/corsego/20-active_...
ActiveStorage docs:
edgeguides.rubyonrails.org/ac...
How to use Credentials in Ruby on Rails 6? TLDR:
blog.corsego.com/ruby-on-rail...
0:00 The Problem
02:01 Install AWS S3 cloud storage
05:19 AWS IAM
08:35 Local storage = S3
09:13 gem aws-sdk-s3
11:05 Production
15:42 Summary

Пікірлер: 34

  • @ogarocious11
    @ogarocious112 жыл бұрын

    You're videos are so great for a newbie coder like me! I'm building my first app and was able to follow along easily! Many thanks!

  • @isaacchuah7543
    @isaacchuah75433 жыл бұрын

    Clear and concise. Thank you so much!

  • @shuya4
    @shuya4 Жыл бұрын

    Your channel is actually amazing. I've been hitting my head for days on it. Following your video, i made it work in less than an hour. Huge thanks

  • @martinkarkovich3037
    @martinkarkovich30372 жыл бұрын

    Great video! Very easy to understand and follow!

  • @wmcraver
    @wmcraver Жыл бұрын

    I just have to say that every time I get stuck with something, I come to your channel to see if you have a video. It never fails that you've already covered the question that I have! I'm grateful that you walked us through the S3 bucket creation . Everyone else glosses over those details like I should already know which settings should be selected.

  • @210779paul
    @210779paul Жыл бұрын

    Very nice and helpful video, Thank a lot :)

  • @enjoythements777
    @enjoythements7773 жыл бұрын

    Great video serie!!

  • @haroldpepete
    @haroldpepete2 жыл бұрын

    Great video my friend, i'm a rails lover

  • @yostin1717
    @yostin17173 жыл бұрын

    loved it!!!! thankuu, subbed!

  • @StrikerSixterGamer
    @StrikerSixterGamer Жыл бұрын

    thanks for the video!

  • @ledockol
    @ledockol3 жыл бұрын

    Thanks!

  • @Prohor21
    @Prohor212 жыл бұрын

    Perfect!

  • @SupeRails

    @SupeRails

    2 жыл бұрын

    Hello Evgenii! Glad that you found the video useful!

  • @MalachiAsgharian
    @MalachiAsgharian Жыл бұрын

    Epic.

  • @NekoManAICore
    @NekoManAICore Жыл бұрын

    thx

  • @acmapps4118
    @acmapps4118 Жыл бұрын

    Hello. I followed your video, however Heroku doesnt take amazon as storage service. It take local configuration. My production.rb has config.active_storage.service = :amazon and i have my credentials set up ok. do you have an idea what is the problem?

  • @kwhandy
    @kwhandy2 жыл бұрын

    do you have video that explain to delete orphaned image file after upload

  • @moran_riv
    @moran_riv2 жыл бұрын

    perfect¡¡

  • @SupeRails

    @SupeRails

    2 жыл бұрын

    Thanks! If you have any ideas for upcoming episodes - please share them!

  • @anastaciomegalordepatricio8342
    @anastaciomegalordepatricio83423 жыл бұрын

    What if we want to save our images in a specific folder/directory inside the bucket ? how we would go about that in rails ? thanks in advance.

  • @SupeRails

    @SupeRails

    2 жыл бұрын

    Good question. I haven't researched it before. The easy way - different buckets for different info. It wouldn't really increase your aws cost. You can override where a file is saved like "has_one_attached :avatar, service: :s3"

  • @tone9270
    @tone92702 жыл бұрын

    I'm having a problem, when i do rails credentials:edit it opens an empty yml file but when I do credentials:show it shows me the default aws stuff so it isn't opening correct file. Can someone help me?

  • @anastaciomegalordepatricio8342
    @anastaciomegalordepatricio83423 жыл бұрын

    Good tutorial ! But i keep getting an error in uploading in the xml response. "The request signature we calculated does not match the signature you provided. Check your key and signing method." "SignatureDoesNotMatch" seems like a key/secret error but i have changed it to newer ones and the issue persists atm

  • @SupeRails

    @SupeRails

    3 жыл бұрын

    Did you update CORS?

  • @anastaciomegalordepatricio8342

    @anastaciomegalordepatricio8342

    3 жыл бұрын

    @@SupeRails yes i've added on my bucket -> Security a json for it. [ { "AllowedHeaders": [ "*" ], "AllowedMethods": [ "GET", "HEAD" ], "AllowedOrigins": [ "*" ], "ExposeHeaders": [], "MaxAgeSeconds": 3000 } ]

  • @anastaciomegalordepatricio8342

    @anastaciomegalordepatricio8342

    3 жыл бұрын

    also i didn't deploy to heroku, i wanted to try in ENV=Development first. I followed along all your steps and somehow got a different outcome so far

  • @SupeRails

    @SupeRails

    3 жыл бұрын

    stackoverflow.com/a/62137151/5695646

  • @anastaciomegalordepatricio8342

    @anastaciomegalordepatricio8342

    3 жыл бұрын

    @@SupeRails so i found out my issue and it was whit the CORS. Notice on the reply here i wasn't allowing any "POST","PUT" or "Delete" methods and they are needed. Ill leave my CORS file in here hope it helps. [ { "AllowedHeaders": [ "*" ], "AllowedMethods": [ "GET", "HEAD", "POST", "PUT", "DELETE" ], "AllowedOrigins": [ "*" ], "ExposeHeaders": [] } ]

  • @Pacowinelover
    @Pacowinelover Жыл бұрын

    Hero without cape

  • @ahmedmunir5128
    @ahmedmunir51282 жыл бұрын

    first of all thank you for your great video but what if i want to upload photos in subdirectories at AWS, for example: photos/user_id/profile_photo.jpeg how to do this using active storage?

  • @SupeRails

    @SupeRails

    2 жыл бұрын

    That's a tough one. Instead of sub-directories, I would maybe just use different AWS buckets... Anyway, did you find an answer? Now I'm curious!

  • @barkbark5645

    @barkbark5645

    2 жыл бұрын

    @@SupeRails You can't do it. I remember this being an issue when Active Storage first came out. Then someone from Rails Core, or Basecamp, said they will not do anything to make it work with folders. Also, thanks for the video.