From f897f12ef5c3a00388b226225fe81de5387e3236 Mon Sep 17 00:00:00 2001 From: Bohung Date: Fri, 28 Jan 2022 15:50:46 +0800 Subject: [PATCH] Fix bug. --- app/controllers/admin/cancerpredicts_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/admin/cancerpredicts_controller.rb b/app/controllers/admin/cancerpredicts_controller.rb index 5afa773..3aa6b02 100644 --- a/app/controllers/admin/cancerpredicts_controller.rb +++ b/app/controllers/admin/cancerpredicts_controller.rb @@ -215,7 +215,11 @@ class Admin::CancerpredictsController < OrbitAdminController item_hash = item_hash.merge(params_cancer[item]) @form_to_show[item] = item_hash elsif @form_to_show[item].class == Array - @form_to_show[item] = YAML.load(params_cancer[item]) + if params_cancer[item].class != Array + @form_to_show[item] = YAML.load(params_cancer[item]) + else + @form_to_show[item] = params_cancer[item] + end @form_to_show[item] = [] if @form_to_show[item].class != Array else @form_to_show[item] = params_cancer[item]