有關如何獲取縮略圖圖像的寬度和高度的任何想法? photo.width返回原始照片的寬度。我將縮略圖的寬度存儲在數據庫中,我只是不確定如何訪問該對象。附件_FU縮略圖寬度
不起作用:
<%= image_tag photo.authenticated_s3_url(:medium),
:width => photo.width,
:height => photo.height %>
無論是做這個的:
<%= image_tag photo.authenticated_s3_url(:medium),
:width => photo.authenticated_s3_url(:medium).width,
:height => photo.authenticated_s3_url(:medium).height %>