From 1b9ba44918244bbe11c7303dc3f72edcd59c28e1 Mon Sep 17 00:00:00 2001 From: chiu Date: Sun, 15 Mar 2020 15:37:14 +0800 Subject: [PATCH] fix error --- app/controllers/admin/seminars_controller.rb | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/app/controllers/admin/seminars_controller.rb b/app/controllers/admin/seminars_controller.rb index f3eb263..ad7f4c9 100644 --- a/app/controllers/admin/seminars_controller.rb +++ b/app/controllers/admin/seminars_controller.rb @@ -78,18 +78,23 @@ class Admin::SeminarsController < OrbitAdminController seminar_main_params = seminar_params seminar_signup_set_params = seminar_main_params['seminar_signup_field_sets'] seminar_submission_set_params = seminar_main_params['seminar_submission_field_sets'] + seminar_email_sets_params = seminar_main_params['seminar_email_sets'] seminar_main_params.delete(:seminar_signup_field_sets) seminar_main_params.delete(:seminar_submission_field_sets) + seminar_main_params.delete(:seminar_email_sets) seminar = SeminarMain.new(seminar_main_params) seminar.create_user_id = current_user.id seminar.update_user_id = current_user.id seminar.save seminar_signup_set_params.each do |key,value| - seminar.seminar_signup_field_sets.create(value) - end - seminar_submission_set_params.each do |key,value| - seminar.seminar_submission_field_sets.create(value) - end + seminar.seminar_signup_field_sets.create(value) + end + seminar_submission_set_params.each do |key,value| + seminar.seminar_submission_field_sets.create(value) + end + seminar_email_sets_params.each do |key,value| + seminar.seminar_email_sets.create(value) + end redirect_to params['referer_url'] end