0
0

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.

Bootstrapの適応方法

0
Posted at

1.gemfileにbootstrapのコードを打ち込む
gem 'bootstrap', '~>4.4.1'
gem 'jquery-rails'

2.application.jsの13~19行目に以下のコードを打ち込む

//= require rails-ujs
//= require activestorage
//= require turbolinks
//= require_tree .
//= require jquery3
//= require popper
//= require bootstrap-sprockets

3.application.cssの1行目に以下のコードを打ち込む
@import "bootstrap";

4.application.cssをapplication.scssに変更する

5.@importの下にcssを書いていく

もし、以下のエラーが出たら
RuntimeError in StaticPages#contact
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>

boot.rbフォルダの最後の行に以下のコードを打ち込む
ENV['EXECJS_RUNTIME'] = 'Node'

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?