This commit is contained in:
邱博亞 2024-08-23 22:35:52 +08:00
parent 3950e63a4a
commit 7e75f3c359
1 changed files with 14 additions and 14 deletions

View File

@ -339,22 +339,22 @@ class Admin::HncCancerPredictsController < OrbitAdminController
end
@site_locales = Site.last.in_use_locales.each do |locale|
I18n.with_locale(locale) do
@file_tmp = File.new(HncCancerPredictfields::ToolTableMap[I18n.locale], "w")
tmp_table_texts = create_table(locale)
@file_tmp.write(tmp_table_texts)
@file_tmp.close
File.open(HncCancerPredictfields::ToolTableMap[I18n.locale], "w") do |f|
tmp_table_texts = create_table(locale)
f.write(tmp_table_texts)
end
end
end
idx = 0
while File.exist?("public/hnc_field_back#{idx}.txt")
idx += 1
end
@file_back = File.open("public/hnc_field_back#{idx}.txt", "w")
@file_back.write(@form_to_show.attributes)
@file_back.close
@file_org = File.open("public/hnc_field_org#{idx}.txt", "w")
@file_org.write(HncCancerPredictfields.where("title" => @app_title + "_back").first.attributes)
@file_org.close
File.open("public/hnc_field_back#{idx}.txt", "w") do |f|
f.write(@form_to_show.attributes)
end
File.open("public/hnc_field_org#{idx}.txt", "w") do |f|
f.write(HncCancerPredictfields.where("title" => @app_title + "_back").first.attributes)
end
redirect_to admin_hnc_cancer_predicts_path
end
@ -665,10 +665,10 @@ class Admin::HncCancerPredictsController < OrbitAdminController
@form_to_show = HncCancerPredictfields.where("title" => @app_title).first
@site_locales = Site.last.in_use_locales.each do |locale|
I18n.with_locale(locale) do
@file_tmp = File.new(HncCancerPredictfields::ToolTableMap[I18n.locale], "w")
tmp_table_texts = create_table(locale)
@file_tmp.write(tmp_table_texts)
@file_tmp.close
File.open(HncCancerPredictfields::ToolTableMap[I18n.locale], "w") do |f|
tmp_table_texts = create_table(locale)
f.write(tmp_table_texts)
end
end
end
else