mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Add StimulusJS controllers via webpacker for the admin
This commit is contained in:
committed by
Nihal M. Kelanthodika
parent
f6e66de52b
commit
49e93a6125
@@ -18,6 +18,8 @@
|
||||
= render "spree/admin/shared/translations"
|
||||
= render "spree/admin/shared/routes"
|
||||
|
||||
= javascript_pack_tag "admin", "data-turbo-track": "reload"
|
||||
|
||||
%script
|
||||
= raw "var AUTH_TOKEN = \"#{form_authenticity_token}\";"
|
||||
|
||||
|
||||
6
app/webpacker/packs/admin.js
Normal file
6
app/webpacker/packs/admin.js
Normal file
@@ -0,0 +1,6 @@
|
||||
import { Application } from "stimulus"
|
||||
import { definitionsFromContext } from "stimulus/webpack-helpers"
|
||||
|
||||
const application = Application.start()
|
||||
const context = require.context("controllers", true, /.js$/)
|
||||
application.load(definitionsFromContext(context))
|
||||
Reference in New Issue
Block a user