1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

railsでbootstrap4をつかう。

Posted at

twbs/bootstrap-sassではbootstrap3までしか使えない。

bootstrap4を使いたかったら
twbs/bootstrap-rubygem
を使う

###1
gemfileに
gem 'bootstrap', '~> 4.0.0.beta'
gem 'jquery-rails'(rails5の時のみ)
でbundle install

###2
mv app/assets/stylesheets/application.css app/assets/stylesheets/application.scss
でファイル名を変えて、

###3

 # app/assets/stylesheets/application.scss
@import "bootstrap";

と記述。その際 *= require and *= require_treeをすべて削除。

 # application.js
//= require jquery3
//= require popper

bootstrap4最高!!!

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?