I have a simple button like they have in the demo:
<button id="track" class="btn" data-toggle="button">Track</button>
and in my application.js file I added:
$('#track').button();
$('#track').live('click', function(event) {
alert('hello!');
});
I added the alert call as a double check – it works. I can confirm that the bootstrap-button.js script is loading and only once. I have played with the javascript load order and that does not seem to make a difference:
//= require jquery
//= require jquery_ujs
//= require twitter/bootstrap
//= require bootstrap
//= require active_admin
I did manage to get it to work once by manually inserting a script tag with bootstrap-button.js inline after the button but now I can’t even re-create that!.
I have Googled and read pretty much all the SO posts on these issues but I figure I must be missing something obvious here.
+1 to @andres-ilich for getting me thinking. active_admin was the conflict. If I load it before twitter/boorstrap it works great.