Reputation: 43
I'm writing a form in rails, styled with Bootstrap 3. My goal is to trigger a tooltip (left) when a user clicks on an input field. I know how to do this with a standard input field, but am at a loss on how to do the same with erb, as follows.
<div class="form-group">
<%= label_tag :teachables, "What do you think you can teach?" %>
<%= f.text_field :teachables, class: 'form-control', placeholder: 'Like piano, sewing, music, etc' %>
</div>
This is the standard bootstrap markup:
<button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="right" title="Tooltip on right">Tooltip on right</button>
Upvotes: 3
Views: 2553
Reputation: 9173
Try:
<div class="form-group">
<%= label_tag :teachables, "What do you think you can teach?" %>
<%= f.text_field :teachables, class: 'form-control', placeholder: 'Like piano, sewing, music, etc', data: {toggle: "tooltip", placement: "left" }, title: "tooltip on second input!" %>
</div>
Upvotes: 5