7 changed files with 42 additions and 17 deletions
@ -0,0 +1,20 @@
|
||||
<span class="non-js-text-search-input-field"> |
||||
<%= f.govuk_text_field "#{category}_text_search".to_sym, |
||||
label: { text: label, hidden: secondary }, |
||||
"data-controller": "search conditional-filter", |
||||
caption: { text: caption_text }, |
||||
"data-info": { search_url: filter_search_url(category.to_sym) }.to_json, |
||||
value: selected_option("#{category}_text_search", @filter_type) %> |
||||
</span> |
||||
<%= f.govuk_select(category.to_sym, |
||||
label: { text: label, hidden: secondary }, |
||||
"data-controller": "search conditional-filter", |
||||
"hidden": true, |
||||
"data-info": { search_url: filter_search_url(category.to_sym) }.to_json) do %> |
||||
<% collection.each do |answer| %> |
||||
<option value="<%= answer.id %>" |
||||
data-hint="<%= answer.hint %>" |
||||
<%= 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