Search code examples
jqueryruby-on-railstwitter-bootstrap-3popover

Bootstrap popover does not work - Even after copying working examples from other posts


I have read through post after post on here, and still cannot get bootstrap popover to work in rails!

Here is the current code I am using.

<script type="text/javascript">
  $('#myPopover').popover();
</script>

And the button:

<button type="button" id="myPopover" class="btn btn-default" data-toggle="popover" data-  placement="right" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus."   data-original-title="" title="">
  Popover on Right
</button> 

Absolutely nothing I try will get the popover to appear though! The demo popovers on the bootstrap website do work however, so It cant be a problem with my browser...

Any tips?


Solution

  • Ok... I finally have this working with both the js menu, and popover. It seems the popover needs the tooltip to be loaded first.

    In vendor/assets/javascripts/bootstrap/bootstrap.js I had to move the //=require ./tooltip.js above //=require ./popover.js This now works perfectly.

    Thanks again for your help guys.