Rails 3.2 Bootstrap Tooltip reports ".tooltip() is not a function"

3.7k Views Asked by At

I'm using a combination of Rails 3.2.5 with bootstrap-sass gem. I've declared the following in application.js to ensure all js plugins are loaded.

//= require bootstrap

To double-check that inclusion succeeds I verify the html source of the page where I'm trying to make the tooltip appear:

<script src="/assets/bootstrap-tooltip.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-popover.js?body=1" type="text/javascript"></script>

I'm trying to make either the tooltip or the popover work on any of the elements on my page. but I always get an error message (both from .js code in the project and when trying this manually from Firebug):

$('#navbar_foobar_link').tooltip();
TypeError: $("#navbar_foobar_link").tooltip is not a function

It doesn't look like the function is available from wherever I'm calling it, even though I'm able to find it under the Scripts tab in Firebug.

What am I doing wrong? I feel like it's got to be something obvious that I'm derping over.

1

There are 1 best solutions below

2
On

Have you tried passing options to the tooltip function like

$('#element').tooltip('show')

Please check link and the provided options Twiiterbootstrap