
Untitled
By: a guest on
May 2nd, 2012 | syntax:
None | size: 0.83 KB | hits: 50 | expires: Never
AWS::S3::S3Object.url_for - How to do this with the new AWS SDK Gem?
def authenticated_url(style = nil, expires_in = 90.minutes)
AWS::S3::S3Object.url_for(attachment.path(style || attachment.default_style), attachment.bucket_name, :expires_in => expires_in, :use_ssl => true)
end
undefined method `url_for' for AWS::S3:Class
def authenticated_url(style = nil, expires_in = 90.minutes)
attachment.s3_object(style).url_for(:read, :secure => true, :expires => expires_in).to_s
end
bucket = AWS::S3::Bucket.new(attachment.bucket_name)
s3object = AWS::S3::S3Object.new(bucket, attachment.path(style || attachment.default_style))
s3object.url_for(:read, :expires => expires_in)
def authenticated_url(style = nil, expires_in = 90.minutes)
self.attachment.expiring_url(expires_in, (style || attachment.default_style))
end