bootstrap_form
bootstrap_form copied to clipboard
Pass additional attributes to the label
trafficstars
Currently, you can do this:
<%= f.text_field :name, label: { text: 'Name', class: 'my-label-class' } %>
This is great if you want to control the class name on the label; however, all other attributes for the label are ignored. Imagine you wanted a tooltip on the label:
<%= f.text_field :name, label: { text: 'Name', data: { toggle: 'tooltip', title: 'My tooltip' } } %>
I think this is probably more predictable behavior.