Add bootstrap in Rails 6 application

Sis Ccr
Nov 28, 2020

--

first remove boostrap and jquery-rails gem from the gemfile if it is installed.

run cmd,

yarn add bootstrap jquery popper.js

add following code in the config/webpack/environment.js

In your app/javascript/packs/application.js file, add

import ‘bootstrap’

rename app/assets/stylesheets/application.css to app/assets/stylesheets/application.scss

remove existing code and add

@import “bootstrap/scss/bootstrap”;

if thats gives problem, try adding ~,

@import “~bootstrap/scss/bootstrap”;

And that should integrate bootstrap in your rails 6 application.

--

--

Sis Ccr
Sis Ccr

Written by Sis Ccr

Depths of ocean could not swallow me.

No responses yet