From cac17bef8cccfe75a34466d746e80de9f69ad945 Mon Sep 17 00:00:00 2001 From: Bohung Date: Thu, 27 Jan 2022 17:02:29 +0800 Subject: [PATCH] Fix bug. --- app/models/cancerpredictfields.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/cancerpredictfields.rb b/app/models/cancerpredictfields.rb index 3661bcb..3f6b76f 100644 --- a/app/models/cancerpredictfields.rb +++ b/app/models/cancerpredictfields.rb @@ -208,12 +208,12 @@ class Cancerpredictfields @years = self.years # @head_name = ['Treatment','Additional_Benefit','Overall_Survival'] @head_name = ['Treatment','Overall_Survival'] - @table_head = @head_name.map{|name| I18n.t('cancerpredict.table.'+name)} @therapy_names = self.treatment_method I18n.available_locales.each do |locale| I18n.with_locale(locale) do + @table_head = @head_name.map{|name| I18n.t('cancerpredict.table.'+name)} @therapy_choices = [I18n.t('cancerpredict.table.Surgeryonly')] - self.form_show_in_result.values.each{|choice| @therapy_choices.push choice["name"][locale]} + self.form_show_in_result.values.each{|choice| @therapy_choices.push choice["name"][locale].to_s} tmp_table = "#{I18n.t("cancerpredict.table.table")}
" tmp_table += '

'+self.table_above_texts[locale].to_s+'

' tmp_table += (''+(locale.to_s == 'zh_tw' ? '第' : '')+'') @@ -234,7 +234,7 @@ class Cancerpredictfields @texts = @texts.split('{{years}}') @texts.delete('') tmp_text = "#{I18n.t("cancerpredict.table.text")}
" - tmp_text += (''+@texts[0]) + tmp_text += (''+@texts[0].to_s) @years.each{|year| tmp_text += ('')} if @texts.count > 1 tmp_text += (@texts[1]+'') if @texts.count > 1 @@ -251,7 +251,7 @@ class Cancerpredictfields @surgery_only_texts = '' end tmp_text += @surgery_only_texts - tmp_text += ''+self.extra_texts[locale]+'

' + tmp_text += ''+(self.extra_texts[locale].to_s rescue '')+'

' tmp_text_translations[locale] = tmp_text end end