fix error

This commit is contained in:
chiu 2021-02-23 17:34:51 +08:00
parent 4f65a30a85
commit 10590cf08d
1 changed files with 3 additions and 3 deletions

View File

@ -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