开发者

changing model-path for paperclip

开发者 https://www.devze.com 2023-02-14 20:22 出处:网络
I set in an initializer the save-path of paperclip to a new one and everything is fine. But some attachment-names (like file) are very abstract:

I set in an initializer the save-path of paperclip to a new one and everything is fine.

But some attachment-names (like file) are very abstract:

has_attac开发者_JAVA百科hed_file :file, :styles => {
    :thumb => "100x100"
}

I want this one within the new save-path, but in a different folder than 'file'. Is that possible, without changing the attachment_name?

For example: Now I'm have something like /save-path/file/thumb, but I want /save-path/my-new-file-name/thumb.


You can manipulate both path and url of the attachment(s) with the Paperclip interpolations. See https://github.com/thoughtbot/paperclip/wiki/interpolations for further reference.

0

精彩评论

暂无评论...
验证码 换一张
取 消