From 905020f18dae1201e77c29be7cbd4151802163b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=8D=9A=E4=BA=9E?= Date: Tue, 19 Sep 2023 21:53:22 +0800 Subject: [PATCH] fix ask setting --- app/controllers/admin/asks_controller.rb | 2 +- app/views/admin/asks/setting.html.erb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/admin/asks_controller.rb b/app/controllers/admin/asks_controller.rb index 5526ff1..e48491d 100644 --- a/app/controllers/admin/asks_controller.rb +++ b/app/controllers/admin/asks_controller.rb @@ -85,7 +85,7 @@ class Admin::AsksController < OrbitAdminController redirect_to "/#{locale}/admin/asks/category_setting" end def setting - @ask_setting = AskSetting.first + @default_ask_setting = AskSetting.first @url = setting_save_admin_asks_path end def backend_table_setting diff --git a/app/views/admin/asks/setting.html.erb b/app/views/admin/asks/setting.html.erb index 22dfe9a..12b06e1 100644 --- a/app/views/admin/asks/setting.html.erb +++ b/app/views/admin/asks/setting.html.erb @@ -28,6 +28,6 @@ $('.add_new_options').sortable({'handle':'.icons-list-2'}); }) -<%= form_for @ask_setting,method: 'post',url: @url,html: { class: 'form-horizontal main-forms previewable' } do |f| %> - <%= render partial: 'ask_setting',locals:{ask_setting: @ask_setting,f: f,submit_text: t('submit'), :@has_email_regex => true} %> +<%= form_for @default_ask_setting,method: 'post',url: @url,html: { class: 'form-horizontal main-forms previewable' } do |f| %> + <%= render partial: 'ask_setting',locals:{ask_setting: @default_ask_setting,f: f,submit_text: t('submit'), :@has_email_regex => true} %> <% end %> \ No newline at end of file