djd
djd

Reputation: 1001

Carrier wave storing images as assets

Iam trying to scrape several product website and build a catalogue of them. I want to download the image of the products using carrier wave and I will be using heroku for hosting. As herkou doesn’t provide is own file system. I was planning on using the downloaded images as assets instead of using a S3 account. can it be done? It seems practical to do is as i will scraping only once in 3 months or something.

Upvotes: 0

Views: 236

Answers (1)

Jesse Wolgamott
Jesse Wolgamott

Reputation: 40277

Sure, you can do this; you'd simply scrape in development, and add the images to your assets. With this, you won't want to use carrierwave, but instead your normal image_tag.

For example, for products, rather than mounting an uploader, you'd have a file_name attribute, and then do something like this to render

<%= image_tag(@product.file_name) %>

Concerns: Heroku has a maximum slug size for your app. That's assets + code + gems. Generally, the apps I run have a slug size around 50 meg. So you'll be limited in total size.

Upvotes: 2

Related Questions