Refactor: use data hash

This commit is contained in:
David Cook
2023-12-12 16:38:03 +11:00
parent a5b2a24dc2
commit e578f697f5

View File

@@ -5,10 +5,14 @@
- if producer_options.many?
.producers
= label_tag :producer_id, t('.producers.label')
= select_tag :producer_id, options_for_select(producer_options, producer_id), include_blank: t('.all_producers'), "data-controller": "tom-select", "data-tom-select-options-value": '{ "plugins": [] }', class: "fullwidth"
= select_tag :producer_id, options_for_select(producer_options, producer_id),
include_blank: t('.all_producers'), class: "fullwidth",
data: { "controller": "tom-select", "tom-select-options-value": '{ "plugins": [] }'}
.categories
= label_tag :category_id, t('.categories.label')
= select_tag :category_id, options_for_select(category_options, category_id), include_blank: t('.all_categories'), "data-controller": "tom-select", "data-tom-select-options-value": '{ "plugins": [] }', class: "fullwidth"
= select_tag :category_id, options_for_select(category_options, category_id),
include_blank: t('.all_categories'), class: "fullwidth",
data: { "controller": "tom-select", "tom-select-options-value": '{ "plugins": [] }'}
.submit
.search-button
= button_tag t(".search"), class: "secondary icon-search relaxed"