【发布时间】:2015-04-16 23:02:49
【问题描述】:
我正在尝试为要上传到我的 mp3 对象设置一些元数据
AWS S3 through Rails 使用回形针。
class myClass < ActiveRecord::Base
attr_accessible :mp3, file_name
attr_accessor :mp3, file_name
has_attached_file :mp3,
// some s3 credential info + bucket
:s3_metadata => {
:name => //get the name attr of the instance that I'm trying to save
}
这在 Model.rb 文件中。
问题是,如果我想将元数据设置为该实例具有的某个属性,
如何在此处访问该值?
【问题讨论】: