【发布时间】:2021-01-27 02:27:42
【问题描述】:
我们目前正在使用 Active Storage 将头像图像上传到 Amazon S3,这在本地和生产环境中都表现出色
class User < ApplicationRecord
has_one_attached :avatar
end
我现在正在尝试使用 Action Text,并按照 Rails Guides 上的说明进行操作,这在 localhost 上运行良好
class Course < ApplicationRecord
belongs_to :user
has_rich_text :content
end
然而,当我部署到生产环境时,富文本格式有效,但附件没有上传到 S3,这让我感到惊讶,因为我认为它使用的活动存储凭据与我们用于上传头像图像的活动存储凭据相同。奇怪的是,它使用文件名填充active_storage_blobs 表,即使它们没有被上传或被active_storage_attachments 引用。
有人可以帮忙吗?
【问题讨论】:
-
需要您的 production.rb 和 gemfile。你通过edgeguides.rubyonrails.org/active_storage_overview.html了吗?
标签: ruby-on-rails activerecord ruby-on-rails-6 rails-activestorage actiontext