爲什麼要添加Js文件? gem應該將它們引入資產管道,您只需要將它們導入到您的Js的application.js文件中,然後爲bootstrap css創建一個css.scss文件,如下所示:
boot.css.scss :
$navbarBackground: #000;
$navbarText: #fff;
$navbarLinkColor: #888;
$navbarBrandColor: #FFF;
@import "bootstrap";
@import "bootstrap-responsive";
的application.js:
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
//= require jquery
//= require jquery_ujs
//= require bootstrap
//= require_tree .
我道歉,如果我還不清楚。當我寫「包括js文件」時,我的意思是將它們添加到application.js。所以,我正在做你在描述的內容。然而,模式不起作用。 – ac360