gemfile
gem 'bootstrap', '~> 4.5'
gem 'jquery-rails'
gem 'font-awesome-sass', '~> 5.13'
bash
$ bundle
app/assets/stylesheets/application.scss
@import "bootstrap";
@import 'font-awesome-sprockets';
@import 'font-awesome';
app/assets/javascripts/application.js
//= require jquery3
//= require popper
//= require bootstrap-sprockets
By default, it is "application.css", but change it to "application.scss". "SCSS" is a CSS extension language that allows you to use bootstrap.
python
ãmv app/assets/stylesheets/application.css app/assets/stylesheets/application.scss
erb:xxx.html.erb
<i class="fas fa-Icon name"></i>
Recommended Posts