From 2d46c6890433ebe26d1db80769235f0cb465299c Mon Sep 17 00:00:00 2001 From: f Date: Thu, 19 Nov 2020 20:38:33 -0300 Subject: [PATCH] activar stimulus --- app/javascript/{packs => }/controllers/geo_controller.js | 0 app/javascript/controllers/index.js | 9 +++++++++ .../{packs => }/controllers/reorder_controller.js | 0 app/javascript/packs/application.js | 8 +------- 4 files changed, 10 insertions(+), 7 deletions(-) rename app/javascript/{packs => }/controllers/geo_controller.js (100%) create mode 100644 app/javascript/controllers/index.js rename app/javascript/{packs => }/controllers/reorder_controller.js (100%) diff --git a/app/javascript/packs/controllers/geo_controller.js b/app/javascript/controllers/geo_controller.js similarity index 100% rename from app/javascript/packs/controllers/geo_controller.js rename to app/javascript/controllers/geo_controller.js diff --git a/app/javascript/controllers/index.js b/app/javascript/controllers/index.js new file mode 100644 index 00000000..6f53d84b --- /dev/null +++ b/app/javascript/controllers/index.js @@ -0,0 +1,9 @@ +// Load all the controllers within this directory and all subdirectories. +// Controller files must be named *_controller.js. + +import { Application } from "stimulus" +import { definitionsFromContext } from "stimulus/webpack-helpers" + +const application = Application.start() +const context = require.context("controllers", true, /_controller\.js$/) +application.load(definitionsFromContext(context)) diff --git a/app/javascript/packs/controllers/reorder_controller.js b/app/javascript/controllers/reorder_controller.js similarity index 100% rename from app/javascript/packs/controllers/reorder_controller.js rename to app/javascript/controllers/reorder_controller.js diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js index 2e9bf178..d3e001a8 100644 --- a/app/javascript/packs/application.js +++ b/app/javascript/packs/application.js @@ -17,13 +17,7 @@ import 'core-js/stable' import 'regenerator-runtime/runtime' - -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)) +import 'controllers' import {EditorState} from "prosemirror-state" import {EditorView} from "prosemirror-view"