我不仅想上传原始图像,还想创建一个缩略图并将这两个文件存储在 S3 中。
我知道通过以下几行很好:
class Asset < ActiveRecord::Base
belongs_to :component
attr_accessible :image
has_attached_file :image, :styles => {:original => "100x100>",
:thumb => "100x100"},
:path => "images/:id/:style_:basename.:extension",
:storage => :s3,
:s3_credentials => {
:bucket => "xxxxxxxx",
:access_key_id => "xxxxxxx",
:secret_access_key => "xxxxxxx"
}
end
但它只保存原始文件。怎么了?