Skip to content

Commit

Permalink
fix js
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-brousse authored and B-Rass committed Apr 3, 2024
1 parent e9dd8b9 commit f238bb1
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 29 deletions.
2 changes: 2 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ class ApplicationController < ActionController::Base
before_action :authenticate_user!
before_action :prepare_exception_notifier

etag { Rails.application.importmap.digest(resolver: helpers) if request.format&.html? }

# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception, unless: -> { request.format.json? }
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/new.application.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
// import "@hotwired/turbo-rails"
import "controllers"
import "@popperjs/core"
import "popper"
import "bootstrap"

document.documentElement.setAttribute('data-bs-theme', (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'))
4 changes: 2 additions & 2 deletions config/importmap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
pin "@hotwired/stimulus-loading", to: "stimulus-loading.js", preload: true
pin "stimulus-reveal-controller" # @4.1.0
pin "tom-select" # @2.3.1
pin "bootstrap" # @5.3.3
pin "@popperjs/core", to: "@popperjs--core.js" # @2.11.8
pin "popper", to: "popper.js", preload: true
pin "bootstrap", to: "bootstrap.js", preload: true

pin_all_from "app/javascript/controllers", under: "controllers"
pin "tom-select" # @1.7.8
2 changes: 1 addition & 1 deletion config/initializers/assets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# folder are already added.
# Rails.application.config.assets.precompile += %w( admin.js admin.css )

Rails.application.config.assets.precompile += %w( bootstrap.js @popperjs--core.js )
Rails.application.config.assets.precompile += %w[bootstrap.js popper.js]
1 change: 0 additions & 1 deletion vendor/javascript/@popperjs--core.js

This file was deleted.

24 changes: 0 additions & 24 deletions vendor/javascript/bootstrap.js

This file was deleted.

0 comments on commit f238bb1

Please sign in to comment.