Skip to content

Commit

Permalink
Got this to work on the groceries app
Browse files Browse the repository at this point in the history
  • Loading branch information
pablobm committed Nov 17, 2023
1 parent 9c30235 commit 15343b9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
6 changes: 3 additions & 3 deletions app/assets/javascripts/administrate/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import jQuery from "jquery"
import Rails from "jquery-ujs"
import "selectize"

import "./components/associative"
import "./components/select"
import "./components/table"
import "administrate/components/associative.js"
import "administrate/components/select.js"
import "administrate/components/table.js"

Rails(jQuery)
4 changes: 0 additions & 4 deletions bin/importmap

This file was deleted.

4 changes: 3 additions & 1 deletion config/importmap.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Pin npm packages by running ./bin/importmap

pin_all_from "app/javascript/administrate/components", under: "components"
pin "administrate/components/table.js", to: "administrate/components/table.js"
pin "administrate/components/associative.js", to: "administrate/components/associative.js"
pin "administrate/components/select.js", to: "administrate/components/select.js"

pin "administrate/application", preload: true

Expand Down
2 changes: 1 addition & 1 deletion lib/administrate/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Engine < ::Rails::Engine
@@stylesheets = []

initializer "administrate.importmap", before: "importmap" do |app|
app.config.importmap.paths root.join("config/importmap.rb")
app.config.importmap.paths << root.join("config/importmap.rb")
end

initializer "administrate.assets.precompile" do |app|
Expand Down

0 comments on commit 15343b9

Please sign in to comment.