From 95009e5c98e84d5fc8b3002b3fe0f9b751ade83f Mon Sep 17 00:00:00 2001 From: chiu Date: Fri, 24 Apr 2020 22:26:38 +0800 Subject: [PATCH 1/2] fix error --- app/controllers/seminars_controller.rb | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/app/controllers/seminars_controller.rb b/app/controllers/seminars_controller.rb index 6e07ed7..5d7165f 100644 --- a/app/controllers/seminars_controller.rb +++ b/app/controllers/seminars_controller.rb @@ -178,17 +178,21 @@ class SeminarsController < ApplicationController update_params = seminar_signup_contribute_params.merge('seminar_submission_values'=>params['seminar_submission_values']) flag = true update_params.permit! - if update_params['seminar_submission_values']['0']['value'].class==String - value = update_params['seminar_submission_values']['0']['value'] - if !value.to_s.blank? - flag = false - end - else - update_params['seminar_submission_values']['0']['value'].each do |key,value| - if !value.to_s.blank? + if !update_params['seminar_submission_values'].nil? + if update_params['seminar_submission_values']['0']['value'].class==String + value = update_params['seminar_submission_values']['0']['value'] + if !value.to_s.blank? flag = false end + else + update_params['seminar_submission_values']['0']['value'].each do |key,value| + if !value.to_s.blank? + flag = false + end + end end + else + flag = false end if flag update_params['seminar_submission_values']['0']['value']['en'] = ' ' From 3456a793577004cd503ef2510106cd71dbe6f279 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 5 May 2020 21:58:59 +0800 Subject: [PATCH 2/2] fix error --- app/views/admin/seminars/export.xlsx.axlsx | 2 +- app/views/admin/seminars/seminar_signup.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/admin/seminars/export.xlsx.axlsx b/app/views/admin/seminars/export.xlsx.axlsx index 5aff95b..340998f 100644 --- a/app/views/admin/seminars/export.xlsx.axlsx +++ b/app/views/admin/seminars/export.xlsx.axlsx @@ -2,7 +2,7 @@ wb = xlsx_package.workbook -wb.add_worksheet(name: @seminar.title) do |sheet| +wb.add_worksheet(name: (@seminar.title.to_s[0..27]+'...')) do |sheet| row = [t('seminar_signup.signup_time')] diff --git a/app/views/admin/seminars/seminar_signup.html.erb b/app/views/admin/seminars/seminar_signup.html.erb index a0cdf31..d3bc449 100644 --- a/app/views/admin/seminars/seminar_signup.html.erb +++ b/app/views/admin/seminars/seminar_signup.html.erb @@ -80,7 +80,7 @@ <% elsif field_set.field_name== 'status' %> <%= t("seminar.registration_status_#{seminar_signup.status}") if !seminar_signup.status.blank? %> - <% else %> + <% elsif field_set.field_name != 'recaptcha' %> <%= seminar_signup.send("#{field_set.field_name}") %> <% end %>