From b949212d1c47288e3939727a0294851232b426ed Mon Sep 17 00:00:00 2001 From: Linus Gasser Date: Fri, 3 Oct 2025 15:48:07 +0200 Subject: [PATCH] Correctly store questions --- app/views/conference_registrations/_questions.html.haml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/conference_registrations/_questions.html.haml b/app/views/conference_registrations/_questions.html.haml index 6e7478d6..68ef891b 100644 --- a/app/views/conference_registrations/_questions.html.haml +++ b/app/views/conference_registrations/_questions.html.haml @@ -3,12 +3,12 @@ - @conference.questions.each do |question| .form-group - if question.question_type.title == 'Yes/No' || question.question_type.title == 'Single Choice' - = f.label :qanswer_ids, question.title - = f.select :qanswer_ids, options_from_collection_for_select(question.qanswers.includes(:answer), :id, lambda { |qa| qa.answer.title }), { include_blank: 'Please make your choice' }, { multiple: false, class: 'form-control' } + %label= question.title + = f.select 'qanswer_ids[]', options_from_collection_for_select(question.qanswers.includes(:answer), :id, lambda { |qa| qa.answer.title }), { include_blank: 'Please make your choice' }, { class: 'form-control' } - if question.question_type.title == 'Multiple Choice' - = f.label :qanswer_ids, question.title + %label= question.title - question.qanswers.includes(:answer).each do |qanswer| .checkbox %label - = f.check_box :qanswer_ids, { multiple: true }, qanswer.id, nil + = check_box_tag 'registration[qanswer_ids][]', qanswer.id, false = qanswer.answer.title