From adc2f62fcbb9d1cb4790c6375efb69a6dc802510 Mon Sep 17 00:00:00 2001 From: Theodor Vararu Date: Fri, 27 Sep 2024 14:06:48 +0300 Subject: [PATCH] Replace consent forms schools autocomplete Use the upstream one instead of the DFE one which has been removed. --- .../consent_forms/edit/school.html.erb | 25 +++++++------------ 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/app/views/parent_interface/consent_forms/edit/school.html.erb b/app/views/parent_interface/consent_forms/edit/school.html.erb index a73cdaf98..900519fb3 100644 --- a/app/views/parent_interface/consent_forms/edit/school.html.erb +++ b/app/views/parent_interface/consent_forms/edit/school.html.erb @@ -16,22 +16,15 @@ If you've moved recently, it's important to mention this.

- <%= render DfE::Autocomplete::View.new( - f, - attribute_name: :location_id, - form_field: f.govuk_select( - :location_id, - options_for_select( - dfe_autocomplete_options( - @consent_form.eligible_schools.map { - OpenStruct.new(name: _1.name, value: _1.id) - } - ), - f.object.id, - ), - label: { text: "Select a school" }, - ), - ) %> + <%= f.govuk_select :location_id, + label: { text: "Select a school" }, + data: { module: "autocomplete" } do %> + <% @consent_form.eligible_schools.map do |school| %> + <%= tag.option(school.name, + value: school.id, + data: { hint: school.address_parts.join(", ") }) %> + <% end %> + <% end %> <%= f.govuk_submit "Continue" %> <% end %>