diff --git a/app/controllers/admin/application_forms_controller.rb b/app/controllers/admin/application_forms_controller.rb index dd89207..d4af843 100644 --- a/app/controllers/admin/application_forms_controller.rb +++ b/app/controllers/admin/application_forms_controller.rb @@ -468,14 +468,14 @@ class Admin::ApplicationFormsController < OrbitAdminController application_form_main_params['application_form_links_attributes'].delete(idx.to_s) if link['url'].blank? end end - application_form_signup_set_params = application_form_main_params['application_form_signup_field_sets'] - application_form_email_sets_params = application_form_main_params['application_form_email_sets'] - application_form_signup_field_customs_params = application_form_main_params["application_form_signup_field_customs"].to_h rescue {} - application_form_main_params["application_form_signup_field_customs"].to_h.each do |k,v| + application_form_signup_set_params = application_form_main_params['application_form_signup_field_sets_attributes'] + application_form_email_sets_params = application_form_main_params['application_form_email_sets_attributes'] + application_form_signup_field_customs_params = application_form_main_params["application_form_signup_field_customs_attributes"].to_h rescue {} + application_form_main_params["application_form_signup_field_customs_attributes"].to_h.each do |k,v| v.delete "title" end - application_form_main_params.delete(:application_form_signup_field_sets) - application_form_main_params.delete(:application_form_email_sets) + application_form_main_params.delete(:application_form_signup_field_sets_attributes) + application_form_main_params.delete(:application_form_email_sets_attributes) application_form = ApplicationFormMain.new(application_form_main_params) application_form.create_user_id = current_user.id application_form.update_user_id = current_user.id @@ -541,8 +541,8 @@ class Admin::ApplicationFormsController < OrbitAdminController if @application_form_params.has_key?("title_translations") @application_form_params["organizer_id"] = nil if @application_form_params["organizer_id"].nil? end - if @application_form_params[:application_form_signup_fields] - @application_form_params[:application_form_signup_fields].each do |a| + if @application_form_params[:application_form_signup_fields_attributes] + @application_form_params[:application_form_signup_fields_attributes].each do |a| @field_name = 'application_form_main' field_status = a.last[:id].present? @attribute_field = ApplicationFormSignupField.add_application_form_signup_field(@application_form, a.last, a.last[:id], field_status) @@ -552,8 +552,8 @@ class Admin::ApplicationFormsController < OrbitAdminController @application_form.application_form_signup_fields.each{|t| t.destroy if t["to_delete"] == true} redirect_to admin_application_forms_path and return - elsif @application_form_params[:application_form_submission_fields] - params[:application_form_main][:application_form_submission_fields].each do |a| + elsif @application_form_params[:application_form_submission_fields_attributes] + params[:application_form_main][:application_form_submission_fields_attributes].each do |a| @field_name = 'application_form_main' field_status = a.last[:id].present? @attribute_field = ApplicationFormSubmissionField.add_application_form_signup_field(@application_form, a.last, a.last[:id], field_status) diff --git a/app/views/admin/application_forms/_form.html.erb b/app/views/admin/application_forms/_form.html.erb index b093086..0551ced 100644 --- a/app/views/admin/application_forms/_form.html.erb +++ b/app/views/admin/application_forms/_form.html.erb @@ -117,15 +117,15 @@ <%= t("application_form_signup.#{attr_signup.field_name}") %>