fix error

This commit is contained in:
chiu 2020-04-24 22:26:38 +08:00
parent 1b9ba44918
commit 95009e5c98
1 changed files with 12 additions and 8 deletions

View File

@ -178,17 +178,21 @@ class SeminarsController < ApplicationController
update_params = seminar_signup_contribute_params.merge('seminar_submission_values'=>params['seminar_submission_values']) update_params = seminar_signup_contribute_params.merge('seminar_submission_values'=>params['seminar_submission_values'])
flag = true flag = true
update_params.permit! update_params.permit!
if update_params['seminar_submission_values']['0']['value'].class==String if !update_params['seminar_submission_values'].nil?
value = update_params['seminar_submission_values']['0']['value'] if update_params['seminar_submission_values']['0']['value'].class==String
if !value.to_s.blank? value = update_params['seminar_submission_values']['0']['value']
flag = false if !value.to_s.blank?
end
else
update_params['seminar_submission_values']['0']['value'].each do |key,value|
if !value.to_s.blank?
flag = false flag = false
end end
else
update_params['seminar_submission_values']['0']['value'].each do |key,value|
if !value.to_s.blank?
flag = false
end
end
end end
else
flag = false
end end
if flag if flag
update_params['seminar_submission_values']['0']['value']['en'] = ' ' update_params['seminar_submission_values']['0']['value']['en'] = ' '