IE11乱码问题

This commit is contained in:
guange 2015-10-13 17:10:46 +08:00
parent 3a98224f6a
commit af03d6c00c
1 changed files with 6 additions and 3 deletions

View File

@ -133,8 +133,9 @@ class StudentWorkController < ApplicationController
format.js format.js
format.html format.html
format.xls { format.xls {
filename = "#{@course.teacher.lastname.to_s + @course.teacher.firstname}_#{@course.name}_#{@course.time.to_s + @course.term}_#{@homework.name}#{l(:excel_homework_list)}.xls"
send_data(homework_to_xls(@stundet_works), :type => "text/excel;charset=utf-8; header=present", send_data(homework_to_xls(@stundet_works), :type => "text/excel;charset=utf-8; header=present",
:filename => "#{@course.teacher.lastname.to_s + @course.teacher.firstname}_#{@course.name}_#{@course.time.to_s + @course.term}_#{@homework.name}#{l(:excel_homework_list)}.xls") :filename => filename_for_content_disposition(filename))
} }
end end
end end
@ -386,8 +387,9 @@ class StudentWorkController < ApplicationController
end end
respond_to do |format| respond_to do |format|
format.xls { format.xls {
filename = "#{@course.teacher.lastname.to_s + @course.teacher.firstname}_#{@course.name}_#{@course.time.to_s + @course.term}_#{@homework.name}#{l(:excel_absence_list)}.xls"
send_data(absence_penalty_list_xls(@stundet_works), :type => "text/excel;charset=utf-8; header=present", send_data(absence_penalty_list_xls(@stundet_works), :type => "text/excel;charset=utf-8; header=present",
:filename => "#{@course.teacher.lastname.to_s + @course.teacher.firstname}_#{@course.name}_#{@course.time.to_s + @course.term}_#{@homework.name}#{l(:excel_absence_list)}.xls") :filename => filename_for_content_disposition(filename))
} }
end end
end end
@ -396,8 +398,9 @@ class StudentWorkController < ApplicationController
def evaluation_list def evaluation_list
respond_to do |format| respond_to do |format|
format.xls { format.xls {
filename = "#{@course.teacher.lastname.to_s + @course.teacher.firstname}_#{@course.name}_#{@course.time.to_s + @course.term}_#{@homework.name}#{l(:excel_evaluation_list)}.xls"
send_data(evaluation_list_xls(@homework.student_works), :type => "text/excel;charset=utf-8; header=present", send_data(evaluation_list_xls(@homework.student_works), :type => "text/excel;charset=utf-8; header=present",
:filename => "#{@course.teacher.lastname.to_s + @course.teacher.firstname}_#{@course.name}_#{@course.time.to_s + @course.term}_#{@homework.name}#{l(:excel_evaluation_list)}.xls") :filename => filename_for_content_disposition(filename))
} }
end end
end end