Twitter Bootstrap

目的

レイアウトやデザインをスタイリッシュに

インストール

Gemfileにslimとbootstrapを追加

gem 'slim-rails'
gem 'twitter-bootstrap-rails'
gem 'twitter_bootstrap_form_for'

gemをインストール

bundle install

bootstrap をインストール

rails g bootstrap:install

レイアウトを作成
http://twitter.github.com/bootstrap/scaffolding.html#layouts

rails g bootstrap:layout application fluid

http://twitter.github.com/bootstrap/examples/fluid.html
or

rails g bootstrap:layout application fixed

http://twitter.github.com/bootstrap/examples/hero.html

erbのレイアウトを削除

rm app/views/layouts/application.html.erb


twitter_bootstrap_form_for は、今回省略します。

Topページ準備

public/index.html を削除

rm public/index.html

home#index を作成

rails g controller home index

config/routes.rb にrootを追加

root to: 'home#index'

確認

rails s

http://localhost:3000/ にアクセスし、確認