kosiakkatrina
1 year ago
committed by
GitHub
4 changed files with 17 additions and 14 deletions
@ -1,7 +1,10 @@ |
|||||||
<%= f.govuk_collection_select category.to_sym, |
<%= f.govuk_select(category.to_sym, |
||||||
collection, |
label: { text: label, hidden: secondary }, |
||||||
:id, |
"data-controller": "accessible-autocomplete conditional-filter") do %> |
||||||
:name, |
<% collection.each do |answer| %> |
||||||
label: { hidden: secondary }, |
<option value="<%= answer.id %>" |
||||||
options: { disabled: [""], selected: selected_option(category, @filter_type) }, |
data-hint="<%= answer.hint %>" |
||||||
"data-controller": %w[accessible-autocomplete conditional-filter] %> |
<%= answer.id.to_s == selected_option(category, @filter_type).to_s ? "selected" : "" %> |
||||||
|
<%= answer.id == "" ? "disabled" : "" %>><%= answer.name %></option> |
||||||
|
<% end %> |
||||||
|
<% end %> |
||||||
|
Loading…
Reference in new issue