I'm using Rails 5.2 and have this simple rails form and a field for the IP address that looks like this:
<%= bootstrap_form_for(@asset, :url => asset_path(@asset.id), :as => :asset, :method => :patch, :layout => :horizontal, :label_col => "col-md-3", :control_col => "col-md-4") do |f| %> <%= f.label :ip_address_locator, 'My NEW label', data: { "toggle"=> "tooltip", "placement"=>"bottom", :title => "This is a tooltip text" } %> <%= f.text_field :ip_address_locator %> <% end %>
I want to update the default label for:
My NEW label
but for some reason the default and new labels show up at the same time.
and when I inspect the labels they seem to be in different divs.
How to only show 'My NEW label' and not both labels?
- I still want to have my tooltip as show on the picture.
By the way I was also able to update my label like this:
<%= f.text_field :ip_address_locator, :label => {:text => 'My NEW label'} %>
But then I don't have access to my tooltip any more.
- I want to be able to update my label text and be able to see my tooltip when hovering on the label just like I have it on my picture.