Hello everyone,
I am trying to implement bootstrap-select, but could not find a way to add attributes to options tag.
The HTML should look like this.
<select class="selectpicker" multiple data-live-search="true">
<option data-tokens="ketchup mustard">Hot Dog, Fries and a Soda</option>
<option data-tokens="mustard">Burger, Shake and a Smile</option>
<option data-tokens="frosting">Sugar, Spice and all things nice</option>
</select>
My code looks like this…
<%=
multiple_select(f, :readers,
select_readers(),
selected: event_selected_readers(@changeset.data),
class: "selectpicker",
data_style: "btn-info",
data_mobile: true,
data_width: "fit"
)
%>
I can add data_live_search: true, but I cannot find a way to add data-tokens attribute to options.
Before I do this with Javascript, I wanted to know if there is a cleaner solution
Thanks for taking time.