fix error

This commit is contained in:
chiu committed 2022-12-31 15:27:56 +08:00
1 parent 9243160b70
commit 5b7cac3970
2 files changed
+4 -3

No files matched your search

+3 -2
View File
@@ -282,7 +282,7 @@ class Admin::AsksController < OrbitAdminController
when 'title','name','mail','phone','appointment'
text = text.gsub(format_text,@ask_question.send(format_text[1...-1]).to_s)
when 'category'
cat = Category.find(@ask_question.ask_category_id).title rescue ''
cat = Category.find(@ask_question.category_id).title rescue ''
text = text.gsub(format_text,cat)
when 'name|mask'
name_tp = @ask_question.name.to_s
@@ -330,6 +330,7 @@ class Admin::AsksController < OrbitAdminController
@print_setting = AskPrintSetting.first if @print_setting.nil?
@save_name = @print_setting.save_name rescue ''
@print_text = @print_setting.print_format rescue ''
@print_text = "<style>img{width: 100%;}</style>"+ @print_text
ask_setting = AskCategorySetting.where(category_id: @ask_question.category_id.to_s, :use_default.ne=>true).first
ask_setting = AskSetting.first if ask_setting.nil?
custom_fields = ask_setting.custom_fields
@@ -465,7 +466,7 @@ class Admin::AsksController < OrbitAdminController
locals: {
:ask_category_settings => ask_category_settings,
:fields_with_key_group => fields_with_key_group,
:categories => categories,
:categories => categories.collect{|c| [c.id, c]}.to_h,
:ask_questions => ask_questions
}
end