Setup Bootstrap in Rails
11 March 2022 (Updated 23 April 2022)
On this page
Download the SCSS files
Download the zip from here.
Copy the scss
directory into a vendor/stylesheets/bootstrap/
directory in your Rails project.
Import the Bootstrap stylesheets in app/assets/stylesheets/application.scss
:
@use '../../../vendor/stylesheets/bootstrap/bootstrap.scss';
(Optional) Pin the JS file
If you need to use Bootstrap components requiring JS, then run:
./bin/importmap pin bootstrap
and import the bootstrap JS inย app/assets/javascripts/application.js
:
import 'bootstrap'
Sources
Tagged:
Rails tooling
Thanks for your comment ๐. Once it's approved, it will appear here.
Leave a comment