From 4e1ade20b006f9c0f71dad142d7a305e49f08331 Mon Sep 17 00:00:00 2001 From: bohung Date: Thu, 7 Jul 2022 17:43:46 +0800 Subject: [PATCH] Fix bug. --- app/views/admin/seminars/_form.html.erb | 6 +++++- app/views/admin/seminars/_get_display_fields.html.erb | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/views/admin/seminars/_form.html.erb b/app/views/admin/seminars/_form.html.erb index dcf6be6..99172a4 100644 --- a/app/views/admin/seminars/_form.html.erb +++ b/app/views/admin/seminars/_form.html.erb @@ -273,9 +273,13 @@ <% @custom_set.each_with_index do |attr_custom,custom_index| %> + <% + seminar_signup_field = SeminarSignupField.where(id:attr_custom.seminar_signup_field_id).first + next if seminar_signup_field.nil? + %> - <%= SeminarSignupField.where(id:attr_custom.seminar_signup_field_id).first.title rescue '' %> + <%= seminar_signup_field.title rescue '' %> diff --git a/app/views/admin/seminars/_get_display_fields.html.erb b/app/views/admin/seminars/_get_display_fields.html.erb index c1e9005..88f212e 100644 --- a/app/views/admin/seminars/_get_display_fields.html.erb +++ b/app/views/admin/seminars/_get_display_fields.html.erb @@ -22,7 +22,7 @@ <% @field_name_translations << t(th) %> <% end %> <% end %> - <% if @seminar.seminar_signup_field_customs.count != 0 %> + <% if false #@seminar.seminar_signup_field_customs.count != 0 %> <% @seminar.seminar_signup_field_customs.each do |field_set| %> <% s = SeminarSignupField.where(id:field_set.seminar_signup_field_id).first %> <% title = s.title rescue '' %> @@ -104,7 +104,7 @@ <% end %> <% end %> <% seminar_signup_field_customs = SeminarSignupFieldCustom.all.map{|field_set| SeminarSignupField.where(id: field_set.seminar_signup_field_id).first}.select{|s| !s.nil?}.uniq{|s| s.key } %> - <% if seminar_signup_field_customs.count != 0 %> + <% if false #seminar_signup_field_customs.count != 0 %> <% seminar_signup_field_customs.each do |s| %> <% title = s.title rescue '' %> <% next if title.blank? %>