&tag(Rails4/Bootstrap); *目次 [#fdfd846d] #contents *関連ページ [#ja90a0ec] [[TwitterBootstrapWithRails]] *参考情報 [#bb976556] -[[Ruby on Rails 4.0正式リリースとBootstrapの正しい設定法 | ユービックログ研究所:http://ubiqlog.com/archives/8749]] -[[Rails 4でRSpecとTwitter Bootstrap - tobioka.net - You Ain't Gonna Need It:http://tobioka.net/765]] *twitter-bootstrap-railsを使って導入 [#b38c3ce8] **Gemfileの編集 [#z023d628] -sass-railsをコメントアウト #gem 'sass-rails', '~> 4.0.2' -以下を追加 #pre{{ gem 'less-rails' gem 'therubyracer' gem 'twitter-bootstrap-rails' #gem 'execjs' }} -bundle install実行 bundle install --path vendor/bundle **Bootstrapを使ったテンプレートの生成 [#h27f2de7] -rails gで生成する。 #pre{{ $ bundle exec rails g bootstrap:install $ bundle exec rails g bootstrap:layout application }} -この段階で一応Bootstrapスタイルが適用される。 **調整 [#o74e59f3] ***ナビゲーションバーがかぶるのを修正 [#yc91306b] -app/assets/stylesheets/bootstrap_and_overrides.css.lessを編集 #pre{{ @import "twitter/bootstrap/bootstrap"; body { padding-top: 60px; } @import "twitter/bootstrap/responsive"; }}