0

enter image description here

Gemfile中的有關部分:

enter image description here導軌和引導(在Windows上) - 空application.css文件和造型將不會加載


捆綁安裝:

enter image description here


並且仍然沒有效果:

enter image description here


由\程序\意見\佈局\ application.html.erb:

<%= stylesheet_link_tag "application", :media => "all" %> 
 
<%= javascript_include_tag "application" %>

的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 any plugin's vendor/assets/javascripts directory 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 
 
// compiled file. JavaScript code in this file should be added after the last require_* statement. 
 
// 
 
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details 
 
// about supported directives. 
 
// 
 
//= require jquery 
 
//= require jquery_ujs 
 
//= require twitter/bootstrap 
 
//= require turbolinks 
 
//= require_tree .

如何裝入引導的造型?

+0

我可以知道app/assets/stylesheets文件夾中的所有文件嗎? – Saran

回答

0

似乎你缺少導入引導樣式。

app/assets/stylesheets/application.scss

// "bootstrap-sprockets" must be imported before "bootstrap" and "bootstrap/variables" 
@import "bootstrap-sprockets"; 
@import "bootstrap"; 

引導鏈輪導入引導樣式必須爲引導圖標字體之前導入的工作:要根據bootstrap-sassdocumentation你應該解決這個問題。

確保文件具有.scss擴展名(或.sass for Sass語法)。如果您剛剛生成了新的Rails應用程序,它可能會附帶.css文件,而不是

0

首先,您應該決定使用哪個gem,twitter-bootstrap-railsbootstrap-sass,而不是兩者。

假設你使用bootstrap-sass然後在application.js應該

//= require bootstrap-sprockets

//= require twitter/bootstrap

然後添加

@import "bootstrap-sprockets"; 
@import "bootstrap"; 

app/assets/stylesheets/application.scssR. Sierra說。

現在你的應用程序應該很好去!