I am currently implementing S3 integration into my Rais application which uses Paperclip. Currently, my model looks as such:
:has_attached_file :picture, :styles => {:medium => "300x300"},
:storage => :s3,
:s3_credentials => S3_CREDENTIALS,
:path => "/:style/:id/:filename"
S3_CREDENTIALS is defined in a file under config/initalizers named s3.rb:
if Rails.env == "production"
#set credentials from ENV hash
S3_CREDENTIALS = {:access_key_id => ENV['S3_KEY'],
:secret_access_key => ENV['S3_SECRET'],
:bucket => ENV['S3_BUCKET']}
else
S3_CREDENTIALS = Rails.root.join("config/s3.yml")
end
The production hases are stored on heroku while the development hash is stored in the s3.yml file. When I call this line in my view,
<%= image_tag (item.picture.url(:medium), :class => "iteminfo" %>
I get a undefined method symbolize_keys error. Any ideas?
You need to close the parentheses in your image_tag
Notice the last parentheses