From 405b2236b3fe84968762b028306befa920904747 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 6 Jan 2020 17:56:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/export_shixun_report_service.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/export_shixun_report_service.rb b/app/services/export_shixun_report_service.rb index 2339b6d56..b75f031c0 100644 --- a/app/services/export_shixun_report_service.rb +++ b/app/services/export_shixun_report_service.rb @@ -33,8 +33,8 @@ class ExportShixunReportService base_css = %w(app/templates/shared/main.css app/templates/shixun_work/shixun_work.css app/templates/shared/codemirror.css) base_css.each { |css| kit.stylesheets << Rails.root.join(css) } - file_name = "#{Rails.root}/files/archiveZip/#{filename}" - kit.to_pdf(file_name) + file = Tempfile.new(filename) + kit.to_pdf(file.path) file end