默认情况下,Carrierwave会应用以下上传器路径:
# Override the directory where uploaded files will be stored.
# This is a sensible default for uploaders that are meant to be mounted:
def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
我想知道将model.id
放在mounted_as
之前是否存在任何错误:
def store_dir
"uploads/#{model.class.to_s.underscore}/#{model.id}/#{mounted_as}"
end
所以例如:
uploads/user/123/avatar
与相比,
是合法的路径
uploads/user/avatar/123