From ea2f8ebf2418c4e4c3ac637f88da66e1f84cf2ee Mon Sep 17 00:00:00 2001 From: chiu Date: Fri, 21 Aug 2020 18:11:52 +0800 Subject: [PATCH] let situation can change --- app/views/admin/asks/_form.html.erb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/views/admin/asks/_form.html.erb b/app/views/admin/asks/_form.html.erb index ddbebc3..a97e969 100644 --- a/app/views/admin/asks/_form.html.erb +++ b/app/views/admin/asks/_form.html.erb @@ -83,11 +83,12 @@ <%= f.label t('situation') %> - <% tmp = {'is_waiting'=>t('ask.is_waiting'), - 'is_processed'=>t('ask.is_processed'), - 'is_referral'=>t('ask.is_referral'), - 'is_published'=>t('ask.is_published')} %> - <%= tmp[@ask_question.situation] %> + <%= f.select :situation, [ + [t('ask.is_waiting'), 'is_waiting'], + [t('ask.is_processed'), 'is_processed'], + [t('ask.is_referral'), 'is_referral'], + [t('ask.is_published'),'is_published'] + ] %>