我正在尝试使用 CarrierWave 发送带有附件的邮件。
在 Mailboxer gem 中,我发现上传者安装了 here.
它使用 AttachmentUploader
作为字段 :attachment
基本功能一切正常。附件存储在 public/uploads 文件夹中。
但我需要向 AttachmentUploader 添加自定义功能(例如更改存储附件的路径等)。
我尝试在 app/uploaders
中创建自己的 attachment_uploader.rb
,但它不起作用。
最佳答案
我刚刚添加到initializers/mailboxer.rb
...
class AttachmentUploader < AllAttachmentUploader
end
它允许我从 AllAttachmentUploader 继承到 Mailboxer 中定义的 AttachmentUploader。
关于ruby-on-rails - 通过 CarrierWave 的邮箱附件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27080066/