1

I've a problem here. I tried to use Bootstrap's tooltip on my project with RubyonRails, but no luck.

I tried to use this solution: Bootstrap Tooltip in Ruby on Rails but still now working.

<%= f.input :company_name, class: "dashbaord-tooltip", :data => 
{:toggle=>"tooltip"}, 'data-original-title' => "Your company name", 'data-
placement' => 'right' %>

do I do it the correct way? thank you in advance.

Ronak Bhatt
  • 162
  • 1
  • 15
Kadir Jailani
  • 119
  • 1
  • 1
  • 15

2 Answers2

0

make sure you call popover method for the class inside your coffee script as follow

jQuery ->
  $(".dashboard-tooltip").popover()

and below is the format (I corrected the spelling for dashboard)

<%= f.input :company_name, :class => 'dashboard-tooltip', data: { content: 'this is the message', placement: 'bottom', trigger: 'hover' } %>
widjajayd
  • 6,090
  • 4
  • 30
  • 41
0

You can enable the tooltip by adding $('[data-toggle="tooltip"]').tooltip(); in your JavaScript file and add this to your form:

<%= f.input :company_name, class: "dashbaord-tooltip", 'data-toggle'=>"tooltip" ,'title'=>'tooltip-text-here','data-placement' => 'right' %>
David Buck
  • 3,752
  • 35
  • 31
  • 35
San
  • 165
  • 1
  • 7