From 10da3d61e2f89ec29ef9f9071c63eb99aa2bb482 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Mon, 10 Feb 2025 17:57:15 +0000 Subject: [PATCH] Alternative way to handle js disabled users --- .../form/_address_search_question.html.erb | 52 ++++++++++++------- app/views/form/page.html.erb | 6 ++- 2 files changed, 39 insertions(+), 19 deletions(-) diff --git a/app/views/form/_address_search_question.html.erb b/app/views/form/_address_search_question.html.erb index 6e27e5018..623fb14e3 100644 --- a/app/views/form/_address_search_question.html.erb +++ b/app/views/form/_address_search_question.html.erb @@ -1,28 +1,44 @@ -<% selected = @log.public_send(question.id) || "" %> <% answers = question.displayed_answer_options(@log, current_user).map { |key, value| OpenStruct.new(id: key, name: select_option_name(value), resource: value) } %> <%= render partial: "form/guidance/#{question.top_guidance_partial}" if question.top_guidance? %> -<%= f.govuk_select(question.id.to_sym, - label: legend(question, page_header, conditional), - "data-controller": "address-search", - "data-info": { search_url: address_search_url }.to_json, - caption: caption(caption_text, page_header, conditional), - hint: { text: question.hint_text&.html_safe }) do %> - <% if answers.any? %> - <% answers.each do |answer| %> - + + +
+ + diff --git a/app/views/form/page.html.erb b/app/views/form/page.html.erb index 7c56b2184..adfabc290 100644 --- a/app/views/form/page.html.erb +++ b/app/views/form/page.html.erb @@ -76,9 +76,13 @@ <% end %> <% if @page.id == "address" %> -