From b08e405784352f374b58b6937fa2ce1c8446efc5 Mon Sep 17 00:00:00 2001 From: Linus Gasser Date: Fri, 3 Oct 2025 15:56:20 +0200 Subject: [PATCH] Fix question answer form --- app/views/conference_registrations/_questions.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/conference_registrations/_questions.html.haml b/app/views/conference_registrations/_questions.html.haml index 68ef891b..bae54c25 100644 --- a/app/views/conference_registrations/_questions.html.haml +++ b/app/views/conference_registrations/_questions.html.haml @@ -4,11 +4,11 @@ .form-group - if question.question_type.title == 'Yes/No' || question.question_type.title == 'Single Choice' %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' } + = select_tag 'registration[qanswer_ids][]', options_from_collection_for_select(question.qanswers.includes(:answer), :id, lambda { |qa| qa.answer.title }, @registration.qanswer_ids), { include_blank: 'Please make your choice', class: 'form-control' } - if question.question_type.title == 'Multiple Choice' %label= question.title - question.qanswers.includes(:answer).each do |qanswer| .checkbox %label - = check_box_tag 'registration[qanswer_ids][]', qanswer.id, false + = check_box_tag 'registration[qanswer_ids][]', qanswer.id, @registration.qanswer_ids.include?(qanswer.id) = qanswer.answer.title