Integration of bootstrap and j-query with rails 6

The initial setups for the project needs the basic things like bootstrap and j-query to make it work people spend a lot of their time on it i will show you quick guide to do this.

Create rails app:

rails new app

after that run this command:

yarn add bootstrap jquery popper.js

This will install all the dependencies.

add these to your application.js

import "bootstrap";
import "./src/application.scss";

make src folder in javascript/packs and inside it make a file application.scss and write this

@import "~bootstrap/scss/bootstrap";

go to your environment.js file

const { environment } = require('@rails/webpacker')const webpack = require('webpack')
environment.plugins.append('Provide', new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
Popper: ['popper.js', 'default']
module.exports = environment

putt this code in it and you are good to go with your rails basic setups with bootstrap and j-query.