Skip to content

Commit

Permalink
Replace consent forms schools autocomplete
Browse files Browse the repository at this point in the history
Use the upstream one instead of the DFE one which has been removed.
  • Loading branch information
tvararu committed Sep 27, 2024
1 parent e32c1af commit a15d00c
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions app/views/parent_interface/consent_forms/edit/school.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,16 @@
If you've moved recently, it's important to mention this.
</p>

<%= 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 %>
<%= tag.option "", value: "" %>
<% @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 %>

0 comments on commit a15d00c

Please sign in to comment.