From c9d670f796a774ba6f6a117a11b6e6527da48bce Mon Sep 17 00:00:00 2001 From: Bohung Date: Wed, 9 Feb 2022 16:04:34 +0800 Subject: [PATCH] Fix bug. --- .../cancerpredicts/_export_cancer_tool_record.xlsx.axlsx | 4 +++- app/views/admin/cancerpredicts/showSubmit.html.erb | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/views/admin/cancerpredicts/_export_cancer_tool_record.xlsx.axlsx b/app/views/admin/cancerpredicts/_export_cancer_tool_record.xlsx.axlsx index cc17054..2194236 100644 --- a/app/views/admin/cancerpredicts/_export_cancer_tool_record.xlsx.axlsx +++ b/app/views/admin/cancerpredicts/_export_cancer_tool_record.xlsx.axlsx @@ -1,7 +1,8 @@ # encoding: utf-8 wb = xlsx_package.workbook -wb.add_worksheet(name: "school_class") do |sheet| +wb.add_worksheet(name: "cancer_tool") do |sheet| + if !@results[0].nil? row = [] title = sheet.styles.add_style(:bg_color => "FFFF00",:border=>{ :style => :thin, :color => "666666" },:alignment=>{ :horizontal => :center,:vertical => :center ,:wrap_text => true}) column = sheet.styles.add_style(:alignment=>{ :horizontal => :center,:vertical => :center ,:wrap_text => true},:border=>{ :style => :thin, :color => "666666" }) @@ -33,4 +34,5 @@ wb.add_worksheet(name: "school_class") do |sheet| export_data_rows.each do |infos_row| sheet.add_row infos_row , :style=> column end + end end \ No newline at end of file diff --git a/app/views/admin/cancerpredicts/showSubmit.html.erb b/app/views/admin/cancerpredicts/showSubmit.html.erb index 885ec2b..d7dc17b 100644 --- a/app/views/admin/cancerpredicts/showSubmit.html.erb +++ b/app/views/admin/cancerpredicts/showSubmit.html.erb @@ -1,14 +1,13 @@ +<% if !@results[0].nil? %> - <% if !@results[0].nil? %> <% @results[0].names.each do |key,name|%> <%end%> - <%end%> @@ -44,6 +43,7 @@ <%end%>
<%=((I18n.locale=="en") ? 'submit time' : '提亀時間') %><%=name[I18n.locale.to_s].to_s.html_safe %>
+<% end %> <%=@pagination.html_safe%>