I am uploading an image to amazon s3 using rails, and the url being returned is incorrect. however, I have noticed that the correct url is available in the :key, looking at my dev server log:
Started GET "/product/add?index=0" for 96.250.13.59 at 2014-06-14 13:04:39 -0400 Processing by ProductsController#saveProduct as HTML Parameters: {"index"=>"0"} "http://s3-us-west-2.amazonaws.com/vigme/products/image_s3s//original/goods_09_086661?1402765480" (0.3ms) BEGIN SQL (4.5ms) INSERT INTO
products
(buy_url
,ftp_transfer_datetime
,ftp_transfer_deleted_source
,ftp_transfer_deleted_source_datetime
,ftp_transfer_processed
,image_s3_content_type
,image_s3_file_name
,image_s3_file_size
,image_s3_updated_at
,image_s3_url
) VALUES ('http://www.uniqlo.com/us/women/outerwear/jackets-and-coats/stretch-tailored/women-stretch-tailored-jacket-086661.html#08', '2014-06-14 17:04:40', 1, '2014-06-14 17:04:40', 1, 'image/jpeg', 'goods_09_086661', 19478, '2014-06-14 17:04:40', 'http://s3-us-west-2.amazonaws.com/vigme/products/image_s3s//original/goods_09_086661?1402765480') [paperclip] saving /products/image_s3s/001/855/192/original/goods_09_086661 [AWS S3 200 0.845202 0 retries] put_object(:acl=>:public_read,:bucket_name=>"vigme",:content_length=>19478,:content_type=>"image/jpeg",:data=>Paperclip::HttpUrlProxyAdapter: goods_09_086661,:key=>"products/image_s3s/001/855/192/original/goods_09_086661")
The last symbol, :key, contains the right url if added to the the amazon s3 url. However, it is returning the url on top. How do i fix this?