<%= render partial: "form/guidance/#{question.guidance_partial}" if question.top_guidance? %> <% selected = @log.public_send(question.id) || "" %> <% answers = question.displayed_answer_options(@log).map { |key, value| OpenStruct.new(id: key, name: value.respond_to?(:service_name) ? value.service_name : nil, resource: value) } %> <%= f.govuk_select(question.id.to_sym, label: legend(question, page_header, conditional), "data-controller": "accessible-autocomplete", caption: caption(caption_text, page_header, conditional), hint: { text: question.hint_text&.html_safe }) do %> <% answers.each do |answer| %> <% end %> <% end %> <%= render partial: "form/guidance/#{question.guidance_partial}" if question.bottom_guidance? %>