Last active
May 12, 2020 16:51
Star
You must be signed in to star a gist
Revisions
-
keithrbennett revised this gist
May 12, 2020 . 1 changed file with 22 additions and 4 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,14 @@ From 83565ac2c24a161af47a79d26e51ab53cc1edb26 Mon Sep 17 00:00:00 2001 From: Keith Bennett <keithrbennett@gmail.com> Date: Tue, 12 May 2020 12:35:02 -0400 Subject: [PATCH 1/4] Add Bootstrap configuration --- app/javascript/packs/application.js | 8 ++++++++ app/javascript/stylesheets/application.scss | 1 + app/views/layouts/application.html.erb | 1 + config/webpack/environment.js | 8 ++++++++ 4 files changed, 18 insertions(+) create mode 100644 app/javascript/stylesheets/application.scss diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js @@ -48,5 +49,22 @@ index ec87c72..0646c51 100644 <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %> </head> diff --git a/config/webpack/environment.js b/config/webpack/environment.js index d16d9af..d28ff4b 100644 --- a/config/webpack/environment.js +++ b/config/webpack/environment.js @@ -1,3 +1,11 @@ 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 -- 2.26.2 -
keithrbennett created this gist
May 12, 2020 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,52 @@ From f9b1b67c46a2d65354ec7125076f58ca73768e5a Mon Sep 17 00:00:00 2001 From: Keith Bennett <keithrbennett@gmail.com> Date: Fri, 1 May 2020 17:02:59 -0400 Subject: [PATCH 1/4] Add Bootstrap configuration --- app/javascript/packs/application.js | 8 ++++++++ app/javascript/stylesheets/application.scss | 1 + app/views/layouts/application.html.erb | 1 + 3 files changed, 10 insertions(+) create mode 100644 app/javascript/stylesheets/application.scss diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js index 9cd55d4..bfd6239 100644 --- a/app/javascript/packs/application.js +++ b/app/javascript/packs/application.js @@ -8,6 +8,14 @@ require("turbolinks").start() require("@rails/activestorage").start() require("channels") +import "bootstrap" +import "../stylesheets/application" + +document.addEventListener("turbolinks:load", () => { + $('[data-toggle="tooltip"]').tooltip() + $('[data-toggle="popover"]').popover() +}) + // Uncomment to copy all static images under ../images to the output folder and reference // them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>) diff --git a/app/javascript/stylesheets/application.scss b/app/javascript/stylesheets/application.scss new file mode 100644 index 0000000..19b0ca9 --- /dev/null +++ b/app/javascript/stylesheets/application.scss @@ -0,0 +1 @@ +@import "~bootstrap/scss/bootstrap"; diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index ec87c72..0646c51 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -6,6 +6,7 @@ <%= csp_meta_tag %> <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> + <%= stylesheet_pack_tag 'application', 'data-turbolinks-track': 'reload' %> <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %> </head> -- 2.17.1