LoginSignup
0
0

More than 3 years have passed since last update.

BootstrapのRubyへの導入方法

Posted at

BootstrapのRubyへの導入方法

過去に作っていたECサイトのコーディングをしようと思いbootstrapの導入を行ったがてこづったので、メモとして投稿しておく。

Gemfile

gem 'bootstrap-sass', '~> 3.3.6'
gem 'jquery-rails'

を記述し、bundle installを実行
bootstrap-sassのバージョンは以下のページにてご自身の環境に合うようにご確認ください。
https://rubygems.org/gems/bootstrap-sass/versions/3.4.1?locale=ja

application.css

application.cssをapplication.scssに変更し、application.scssに

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

application.js

//= require jquery
//= require bootstrap-sprockets

を追加で記入

これでBootstrapを思いの儘に使えます。
Gemfileにbootstrapの記述を書いて満足して、scssファイルやjsファイルへの記述忘れがちですね。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0