The data attribute does not get rendered on this select tag. Any idea what I'm missing?
=f.select :template_kind, options_for_select(f.object.class::TEMPLATE_KINDS, selected: f.object.template_kind), include_blank: true, data: {target: "template-form.switch", action: "change->template-form#handleChange"}
Even a class attribute does not get rendered:
=f.select :template_kind, options_for_select(f.object.class::TEMPLATE_KINDS, selected: f.object.template_kind), include_blank: true, class: "myclass"
This is the output, in both cases:
<select name="system_template[template_kind]" id="system_template_template_kind">
<option value=""></option>
<option value="email_message">email_message</option>
<option selected="selected" value="page">page</option>
</select>
If I move the data attributes or class on another (non-select) tag, they get rendered.
Latest versions of both Rails and slim-lang
The documentation shows that starting with the third parameter it should be possible to specify html attributes https://api.rubyonrails.org/v6.0.3.2/classes/ActionView/Helpers/FormTagHelper.html#method-i-select_tag