dev_course
SylorHuang 5 years ago
parent 0ef3779b17
commit 33cc969d88

@ -1294,7 +1294,7 @@ class ExercisesController < ApplicationController
get_export_users(@exercise,@course,@export_ex_users) get_export_users(@exercise,@course,@export_ex_users)
exercise_export_name = "#{current_user.real_name}_#{@course.name}_#{@exercise.exercise_name}" exercise_export_name = "#{current_user.real_name}_#{@course.name}_#{@exercise.exercise_name}"
ex_xlsx = render_to_string handlers: [:axlsx], formats: [:xlsx], template: "exercises/exercise_lists.xlsx.axlsx", locals: {table_columns:@table_columns,exercise_users:@user_columns} ex_xlsx = render_to_string handlers: [:axlsx], formats: [:xlsx], template: "exercises/exercise_lists.xlsx.axlsx", locals: {table_columns:@table_columns,exercise_users:@user_columns}
zip_file = Tempfile.new(["#{exercise_export_name}","xlsx"],"/home/tmp") zip_file = Tempfile.new(exercise_export_name,"/home/tmp")
zip_file.write(ex_xlsx) zip_file.write(ex_xlsx)
zip_file.close zip_file.close
# render json{:status => 0,"file_name":"#{exercise_export_name}"} # render json{:status => 0,"file_name":"#{exercise_export_name}"}

Loading…
Cancel
Save