Attachment_fu:无法禁用:分区选项
我正在尝试在 Rails 项目中使用 Attachment_Fu 插件,并且想要自定义上传的路径文件已保存。
文档显示了此选项:
:partition #是否分区 对目录中的文件进行分区,例如 /0000/0001/图像.jpg。默认值为 true。
(0001 部分是表中的 ID。)我不希望这样,因此我将分区选项设置为 false,如下所示:
class Photo < ActiveRecord::Base
has_attachment :content_type => :image,
:storage => :file_system,
:max_size => 500.kilobytes,
:resize_to => '320x200',
:thumbnails => {:thumb => '100x100>' },
:partition => false
validates_as_attachment
end
...but the :partition =>; false
选项无效。
还有其他人遇到过这个问题吗?你是怎么解决的?
I'm trying to use the Attachment_Fu plugin in a Rails project, and want to customize the paths where uploaded files are saved.
The documentation shows this option:
:partition # Whether to
partiton files in directories like
/0000/0001/image.jpg. Default is true.
(The 0001 part is an ID from a table.) I don't want that, so I set the partition option to false, like so:
class Photo < ActiveRecord::Base
has_attachment :content_type => :image,
:storage => :file_system,
:max_size => 500.kilobytes,
:resize_to => '320x200',
:thumbnails => {:thumb => '100x100>' },
:partition => false
validates_as_attachment
end
...but the :partition => false
option has no effect.
Has anybody else encountered this problem? How did you fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您可能还需要指定
是否禁用自动分区。
I think you may also need to specify
If you are disabling the auto partitioning.