Closed victorbstan closed 10 years ago
I'm having the same issue.
+1 popover not working
twitter-bootstrap-rails 2.1.9
<a href="#" data-content="Pizza Description" data-original-title="Pizza" rel="popover">Pizza</a>
$("a[rel=popover]").popover(
placement: "bottom",
trigger: "hover"
)
same issue here. From the inspector:
$('a[rel="popover"]')
[
<a href="#" rel="popover" class="test_class" data-content="popover content" data-title="popover title">click</a>
,
<a href="#" rel="popover" class="test_class" data-content="popover content" data-title="popover title" data-trigger="hover">hover</a>
]
$('a[rel="popover"]').popover()
TypeError: Cannot call method '_init' of undefined
+1 with this problem. using bootstrap-sass 2.2.2.0 and sass-rails 3.2.5
line 540 in jquery-ui.js
instance.option( options || {} )._init();
seems to be the culprit.
Same problem here :(
doesn't the docs for twitter bootstrap specify that you must include the popover and tooltip api's manually to get them to work? Here's what it says:
"For performance reasons, the tooltip and popover data-apis are opt in, meaning you must initialize them yourself."
here: http://twitter.github.com/bootstrap/javascript.html#tooltips
victorbstan, you don't appear to be doing this. Has anyone else tried it?
well, i do have the lines
<script src="/assets/bootstrap-tooltip.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-popover.js?body=1" type="text/javascript"></script>
in the source code of the page in question. or do they mean something else by initializiing?
Also having the same problem. @chewmanfoo I believe that by default twitter-bootstrap-rails includes all the bootstrap plugins when you have the line //= require twitter/bootstrap in your manifest
I had the same error - it ended up being a conflict with ActiveAdmin's JS. When I removed AA's scripts the popover worked again.
@rdeshpande that solved it. thank you.
rdeshpande - sorry to be sush a noob, but how exactly did you surgically remove active admin from your rails app? Just remove it from the Gemfile and do bundle update?
@chewmanfoo that works if you don't need activeadmin - they are separate gems so you could surely remove it. However, if you need ActiveAdmin you would remove it from your application.js (or wherever it's being required) and then only use it in your ActiveAdmin layouts.
@chewmanfoo i did it (mostly) following this explanation.
Can you check that your application.js looks something like this one:
https://github.com/toadkicker/teststrap/blob/master/app/assets/javascripts/application.js
I'm happy to report that it works fine now after removing the active_admin js from my assets