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 c5e018d commit adc2f62
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 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,15 @@
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 %>
<% @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 adc2f62

Please sign in to comment.