在 ActiveStorage 中使用多个存储桶 [英] Using multiple buckets with ActiveStorage

查看:33
本文介绍了在 ActiveStorage 中使用多个存储桶的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道是否有办法为特定附件配置自定义存储桶?

Does anyone know if there is a way to configure custom buckets for specific attachments?

class MyModel < ApplicationRecord
  ...

  has_one_attached :logo, bucket: 'custom_bucket'

  ...    
end

推荐答案

没有,抱歉.Active Storage 设计用于单个存储分区.

There isn’t, sorry. Active Storage is designed for use with a single bucket.

这篇关于在 ActiveStorage 中使用多个存储桶的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆