From 10590cf08d8091f1ecfb3ecef4d1be4b1bf4eb08 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 23 Feb 2021 17:34:51 +0800 Subject: [PATCH] fix error --- app/controllers/admin/asks_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/admin/asks_controller.rb b/app/controllers/admin/asks_controller.rb index 7b70195..268caf1 100644 --- a/app/controllers/admin/asks_controller.rb +++ b/app/controllers/admin/asks_controller.rb @@ -181,7 +181,7 @@ class Admin::AsksController < OrbitAdminController i = format_text.scan(/\d+/)[0] k = custom_fields.keys.index(i) rescue nil if !k.blank? - text_tp = custom_fields[k]['field'][I18n.locale] rescue '' + text_tp = custom_fields.values[k]['field'][I18n.locale] rescue '' text = text.gsub(format_text,text_tp) end when 'title' @@ -226,7 +226,7 @@ class Admin::AsksController < OrbitAdminController i = format_text.scan(/\d+/)[0] k = custom_fields.keys.index(i) rescue nil if !k.blank? - v = custom_fields[k] rescue {} + v = custom_fields.values[k] rescue {} text_tp = Admin::AsksHelper.show_on_front(k,v,@ask_question.custom_values[k],true,true) text = text.gsub(format_text,text_tp.to_s) end @@ -234,7 +234,7 @@ class Admin::AsksController < OrbitAdminController i = format_text.scan(/\d+/)[0] k = custom_fields.keys.index(i) rescue nil if !k.blank? - v = custom_fields[k] rescue {} + v = custom_fields.values[k] rescue {} text_tp = Admin::AsksHelper.show_on_front(k,v,@ask_question.custom_values[k],true) text = text.gsub(format_text,text_tp.to_s) end