【发布时间】:2018-04-15 11:06:54
【问题描述】:
我正在使用 wicked_pdf 生成 pdf 文件并希望将其上传到 s3 存储桶,因为 heroku 不公开保存。但面临如何上传或如何在保存路径中提供 s3 存储桶路径的问题。
这是我的控制器代码:-
pdf = render_to_string :pdf => "user_detail"
# then save to a file
save_path = Rails.root.join('pdfs','filename.pdf')
File.open(save_path, 'wb') do |file|
file << pdf
end
【问题讨论】:
标签: ruby-on-rails ruby amazon-web-services amazon-s3 wicked-pdf