4

twitter-bootstrap-rails gemとアセットパイプラインを正しく統合するにはどうすればいいですか?twitterのブートストラップをレールアセットパイプライン以下で使用する

私は、インストールの手順に従ってきたし、現在、私はこれは

*= require_self 
*= require bootstrap_and_overrides 

をapplication.cssている。そしてbootstrap_and_overrides.css.lessに私は私の変数が定義されてそれらを動作させるために他のコントローラのスタイルシートをインポートしていますオーバーライドファイル内にあり、<controller-name>.css.lessファイル内のコントローラ固有のスタイルシート内でブートストラップミックスインを使用できるようにする必要があります。現在、私はこれをやっている:

# in bootstrap_and_overrides.css.less 
// generated code ... 
// Your custom LESS stylesheets goes here 
// 
// Since bootstrap was imported above you have access to its mixins which 
// you may use and inherit here 
// 
// If you'd like to override bootstrap's own variables, you can do so here as well 
// See http://twitter.github.com/bootstrap/less.html for their names and documentation 
// 
// Example: 
// @linkColor: #ff0000; 
@linkColor: #ff0000; 

// import all other stylesheets 
@import 'home.css.less'; 
@import 'users.css.less'; 
// and so on, once for every controller 

// in home.css.less 
#foobar { 
    .border-radius(30px); // bootstrap mixin 
    color: @linkColor; // inherited variable 
} 

しかし、このように私は、資産のパイプラインを失っていると私はもう開発モードで個々のスタイルシートを見ることができません。 twitter-bootstrap-railsをスプロケットで動作させる方法はありますか?

答えて

5

this githubの問題があなたの質問を説明しています。つまり、スクロールを使用すると、個々のファイルが個別にコンパイルされるため、twitterブートストラップフレームワークで定義された変数やミックスインは使用できなくなります。だから私は答えはないと思う:)