This is the first time I'm using Paperclip and Amazon S3 and I'm pretty sure I'm missing something obvious. It would be great if somebody can point it out.
In S3 bucket, I have 2 folders, development and production, to upload images to corresponding folders based on the environment. I tried the solution proposed here as follows in my model.rb
-
options = {}
if Rails.env.production?
options[:path] ||= 'production'
else
options[:path] ||= 'development'
end
has_attached_file :picture, options
I kept getting a file named development / production uploaded to the S3 bucket (as shown in the screenshot).
I even tried passing the :path
as config setting for paperclip. Same thing happened - a folder named development / production was getting uploaded
Am I missing something here? All I want to do, upload pictures I get in the development environment into the development folder and vice versa for production.