Browse Source

feat: make autocomplete accesible and la readable

CLDC-1390-la-lookup-fallback-WIP
natdeanlewissoftwire 2 years ago
parent
commit
ed955a5bf1
  1. 2
      app/controllers/locations_controller.rb
  2. 4
      app/views/locations/la_fallback.html.erb

2
app/controllers/locations_controller.rb

@ -103,7 +103,7 @@ private
end
def location_params
required_params = params.require(:location).permit(:postcode, :name, :units, :type_of_unit, :add_another_location, :startdate, :mobility_type).merge(scheme_id: @scheme.id)
required_params = params.require(:location).permit(:postcode, :name, :units, :type_of_unit, :add_another_location, :startdate, :mobility_type, :location_admin_district).merge(scheme_id: @scheme.id)
required_params[:postcode] = PostcodeService.clean(required_params[:postcode]) if required_params[:postcode]
required_params
end

4
app/views/locations/la_fallback.html.erb

@ -336,10 +336,10 @@
<%= f.govuk_collection_select :location_admin_district,
las,
:id,
:name,
:name,
label: { hidden: true },
"data-controller": %w[accessible-autocomplete conditional-filter] %>
"data-controller": %w[conditional-filter accessible-autocomplete] %>
<%= f.hidden_field :page, value: "la-fallback" %>

Loading…
Cancel
Save