how do I make bootstrap work on my custom layouts in rails 6
I have install bootstrap with the yarn add bootstrap jquery popper.js command and configured my the ..app/config/webpack/environment.js as follow.
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 ..app/javascript/packs/application.js
... import 'bootstrap' import "../stylesheets/application" ..app/javascript/stylesheets/application.scss
@import '~bootstrap/scss/bootstrap'; Everything works fine but when I created another layout file,the layout does not import the bootstrap library.
..layout/visitor.html.erb
<html> ..... <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %> .... The bootstrap library is not loaded in this visitor.html.erb layout it is loaded only in the application.html.erb layout file.
how to fix the problem