I've been trying to use the s3_host_alias option to specify my
cloudfront URL, but the #url method keeps returning the
s3.amazonaws.com url.
Here's my Picture model with the attachment:
class Picture < ActiveRecord::Base
has_attached_file :image, :path =>
"images/:class/:id/:basename.:style.:extension",
:storage => :s3,
:s3_credentials => "#{RAILS_ROOT}/config/
s3.yml",
:bucket => 'themesagogo',
:s3_host_alias =>
'
themesagogo1.thrivesmart.net'
validates_attachment_size :image, :less_than => 1.megabytes
end
And here's how I'm calling URL:
@picture.image.url
Is there something I'm missing in the options sent to
has_attached_file, or am I calling the wrong method (something other
than .url)?
I hope this has an easy answer - I just couldn't find any documented
examples of it anywhere.
Thanks!