Seeding multiple image attachments from Amazon S3 in Rails

0 votes

I am trying to seed multiple image attachments to a model. I have been using this link but I am still sort of stuck since what I aim to do differs a little since:

  1. I am trying to attach multiple images to each object (which I seed) in the model
  2. I want to retrieve these images from my S3 bucket and attach them to the objects (is this possible?)

Here's my seed.rb:

shirt = Item.create(name:"Basic Shirt",price:19.99)
skirt = Item.create(name:"Basic Skirt",price:29.99)
sweater = Item.create(name:"Basic Sweater",price:39.99)
kid_hood = Item.create(name:"Basic Kid Hoodie",price:19.99)

# somehow attach images here?

I am using the aws-sdk-s3 gem in order to connect Active Storage to my S3 bucket. Please tell me if any additional files are needed for viewing. I will happily edit this post to include it.

Mar 2, 2022 in Power BI by Edureka
• 13,690 points
910 views

1 answer to this question.

0 votes

In many Ruby on Rails apps, file uploading is a crucial feature. For a long time, the Paperclip gem was thought to be the best option for this. Active Storage is currently the preferred method for enabling file uploading in Rails applications, thanks to its recent deprecation. Active Storage is a Rails feature that allows users to upload files to a variety of cloud storage services in a variety of contexts. Amazon S3, Google Cloud Storage, and Microsoft Azure Storage are some of the services available. It also offers a local-disk-based service for usage throughout the application development process.

Empower Your Data Insights with Power BI Certification.

answered Mar 2, 2022 by gaurav
• 23,260 points

Related Questions In Power BI

0 votes
1 answer
0 votes
1 answer

Applying multiple filters in PBI Embed URL

Well, that is actually a limitation in ...READ MORE

answered Aug 21, 2018 in Power BI by DataKing99
• 8,250 points
3,125 views
0 votes
1 answer

Embed URL-multiple filters in Power BI

With the release of 2.0.0 you can ...READ MORE

answered Oct 16, 2018 in Power BI by Annie97
• 2,160 points
3,897 views
+1 vote
1 answer

Have column with multiple values in powerBI, for use with a slicer in power bi

It can be achieved depending on the result you ...READ MORE

answered Oct 22, 2018 in Power BI by Hannah
• 18,520 points
7,490 views
+1 vote
1 answer

Show the latest value in PowerBi from ASA

Best you can do right now is ...READ MORE

answered Oct 25, 2018 in Power BI by Surendra
1,585 views
0 votes
1 answer

Select Columns from table instead of removing afterwards in Power Query

Try this. let db = Sql.Databases("sqlserver.database.url"){[Name="DatabaseName"]}[Data], Sales_vDimCustomer = ...READ MORE

answered Oct 31, 2018 in Power BI by Shubham
• 13,490 points
3,584 views
0 votes
1 answer

Bar chart : Arranging in descending order using data from another chart

Select treemap.  Make it active.  Turn on Visual Interactions ...READ MORE

answered Feb 8, 2019 in Power BI by Upasana
• 8,620 points
879 views
0 votes
1 answer

Replace “yes” found in one list with the actual string from another list

Objective : The idea is to use List.Transform twice, ...READ MORE

answered Feb 19, 2019 in Power BI by Upasana
• 8,620 points
820 views
0 votes
1 answer

What is the meaning of Duration in Amazon RDS Backup window

The duration window indicates the time in which ...READ MORE

answered Mar 2, 2022 in Power BI by gaurav
• 23,260 points
1,100 views
0 votes
1 answer

Exporting a table from Amazon RDS into a CSV file

To upload PostgreSQL data to S3, use ...READ MORE

answered Mar 2, 2022 in Power BI by gaurav
• 23,260 points
1,155 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP