我已经尝试了一切,但仍然无法使其正常工作。
我的系统中有两种类型的申请,它们经过资格预审并发送给贷方,
1) 一个生成 pdf 2) 第二个应该使用活动存储附件并将它们附加到 ActionMailer
第一个正在工作,第二个给了我以下错误:
[ActionMailer::DeliveryJob] [905177a5-b0e9-46f4-ba9a-fc4630e873f9] 执行 ActionMailer::DeliveryJob 时出错(作业 ID:905177a5-b0e9-46f4-ba9a-fc469a-fc4630e87)ErOsync:ErO4630e870 (没有这样的文件或目录@ rb_sysopen - https://funderhunt.co/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBZ1lIIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--fa91a15681c23d47d767169c7821601aa15ed2b3/Statuses.pages?disposition=attachment):
链接是正确的:
这部分的邮件程序代码如下所示:
q = 0
statement.files.each do |file|
q += 1
bank_statement = File.read(rails_blob_url(file, disposition: "attachment"))
attachments["statement_#{q}.pdf"] = { :mime_type => 'application/pdf', :content => bank_statement }
end
Run Code Online (Sandbox Code Playgroud)
怎么了?你能帮忙吗。提前致谢。