Skip to content

Instantly share code, notes, and snippets.

@siassaj
Last active December 16, 2015 02:18
Show Gist options
  • Save siassaj/5361040 to your computer and use it in GitHub Desktop.
Save siassaj/5361040 to your computer and use it in GitHub Desktop.
config.paperclip_defaults = {
:storage => :s3,
:url => ":s3_domain_url"
:s3_host_name => "s3.amazonaws.com",
:s3_credentials => {
:bucket => 'healthyhabitsutah',
:access_key_id => ENV['AWS_KEY'],
:secret_access_key => ENV['AWS_SECRET']
}
}
# the correct url to an image is:
# http://healthyhabitsutah.s3.amazonaws.com/testimonials/thumbnails/000/000/002/original/rosemary.jpg
#
# what i'm getting is:
# http://healthyhabitsutah.s3.amazonaws.com/healthyhabitsutah/testimonials/thumbnails/000/000/002/original/rosemary.jpg?1365652286
config.paperclip_defaults = {
storage: :s3,
url: ":s3_domain_url",
s3_credentials: {
s3_host_name: 's3-ap-southeast-2.amazonaws.com',
bucket: "daybookstest",
# daybooktest user
access_key_id: "aoeu",
secret_access_key: "aoeu"
},
s3_headers: { :server_side_encryption => :aes256 },
s3_permissions: :private
}
class Testimonial < ActiveRecord::Base
attr_accessible :comment, :date, :name, :thumbnail
has_attached_file :thumbnail,
:styles => {
thumb: '100x100>',
full: '300x300>'
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment