2
我遇到了Bootstrap的Javascript部分與我的Rails應用程序無法正常工作的問題。例如,下面的代碼應該使用Bootstrap version of the popover,但是,當我將鼠標懸停在我的鏈接上時,我只是獲得了基本的工具提示。我錯過了什麼?Bootstrap JS不能在Rails 4中工作
的Gemfile
gem "bootstrap-sass"
的application.js
//= require modernizr
//= require jquery
//= require jquery_ujs
//= require jquery.cookie
//= require jquery.piechart
//= require jquery.dlmenu
//= require jquery.tooltipster
//= require bootstrap-sprockets
//= require mithril
//= require_tree .
application.css.scss
/*
*= require bootstrap
*= require font-awesome.min
*= require tooltipster
*= require_self
*/
@import "normalize";
@import "util";
@import "bootstrap-sprockets";
@import "bootstrap";
@import "fonts";
@import "app";
@import "media-queries";
@import "login";
@import "header";
@import "alerts";
@import "hero";
@import "feedback";
@import "reports";
@import "main-content";
@import "popovers";
@import "push-menus";
@import "footer";
index.html.erb
<a tabindex="0" role="button"
data-toggle="popover" data-trigger="focus"
title="Severity Score" data-content="Severity score is...">
<%= image_tag("tooltips/tooltip-question.png") %>
</a>
是啊,這是卓有成效的。我認爲HTML5的'數據切換'應該讓它工作,而不必做JS。 – Godzilla74