我正在尝试更改照片的basename(filename):
在我的模型中,我有:
attr_accessor :image_url,:basename has_attached_file :image,:styles => { :original => ["300x250>",:png],:small => ["165x138>",:png] },:url => "/images/lille/:style/:id/:basename.:extension",:path => ":rails_root/public/images/lille/:style/:id/:basename.:extension" before_save :basename private def basename self.basename = "HALLLO" end
但文件名完全没有改变.