From 7e544b3fa487b8ec0a5187acbc1f69d9d2837dfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=8D=9A=E4=BA=9E?= Date: Thu, 18 Nov 2021 16:11:37 +0800 Subject: [PATCH] fix error --- app/controllers/admin/actives_controller.rb | 4 ++-- app/views/admin/actives/export.xlsx.axlsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/admin/actives_controller.rb b/app/controllers/admin/actives_controller.rb index 94e7384..9f2813e 100644 --- a/app/controllers/admin/actives_controller.rb +++ b/app/controllers/admin/actives_controller.rb @@ -86,10 +86,10 @@ class Admin::ActivesController < OrbitAdminController end def export - + title = @act.title.gsub(/\\|\//,'_') respond_to do |format| format.xlsx { - response.headers['Content-Disposition'] = 'attachment; filename="export.xlsx"' + response.headers['Content-Disposition'] = "attachment; filename=\"#{title}.xlsx\"" } end diff --git a/app/views/admin/actives/export.xlsx.axlsx b/app/views/admin/actives/export.xlsx.axlsx index 07da836..aa0e1fc 100644 --- a/app/views/admin/actives/export.xlsx.axlsx +++ b/app/views/admin/actives/export.xlsx.axlsx @@ -2,7 +2,7 @@ wb = xlsx_package.workbook -wb.add_worksheet(name: @act.title) do |sheet| +wb.add_worksheet(name: t('module_name.active')) do |sheet| row = []