Skip to content

Instantly share code, notes, and snippets.

@pjbelo
Last active June 10, 2021 09:23
Show Gist options
  • Save pjbelo/0d59d753dd8a39499dd954300dee3b1a to your computer and use it in GitHub Desktop.
Save pjbelo/0d59d753dd8a39499dd954300dee3b1a to your computer and use it in GitHub Desktop.
Add Bootstrap to Rails 6

Add Bootstrap 4 to Rails 6

run in terminal (project dir):

yarn add [email protected] jquery popper.js

file: app/assets/stylesheets/application.css

rename to: .scss

insert: *= require bootstrap

in file: app/javascript/packs/application.js

insert: import "bootstrap"

in file: config/webpack/environment.js

insert:

const webpack = require("webpack")
environment.plugins.append("Provide", new webpack.ProvidePlugin({
         $: 'jquery',
         jQuery: 'jquery',
         Popper: ['popper.js', 'default']
}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment