diff options
| author | realtradam <[email protected]> | 2024-05-21 23:32:53 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2024-05-21 23:32:53 -0400 |
| commit | 80d64e04441ced7caecd238ae232e749d8e0dddf (patch) | |
| tree | c41d7803a15aa99b51703bbecc56ec2ed2233431 /src/controllers | |
| download | malcz.com-80d64e04441ced7caecd238ae232e749d8e0dddf.tar.gz malcz.com-80d64e04441ced7caecd238ae232e749d8e0dddf.zip | |
initial setup of seperating frontend
Diffstat (limited to 'src/controllers')
| -rw-r--r-- | src/controllers/application.js | 9 | ||||
| -rw-r--r-- | src/controllers/hello_controller.js | 7 | ||||
| -rw-r--r-- | src/controllers/index.js | 8 |
3 files changed, 24 insertions, 0 deletions
diff --git a/src/controllers/application.js b/src/controllers/application.js new file mode 100644 index 0000000..1213e85 --- /dev/null +++ b/src/controllers/application.js @@ -0,0 +1,9 @@ +import { Application } from "@hotwired/stimulus" + +const application = Application.start() + +// Configure Stimulus development experience +application.debug = false +window.Stimulus = application + +export { application } diff --git a/src/controllers/hello_controller.js b/src/controllers/hello_controller.js new file mode 100644 index 0000000..5975c07 --- /dev/null +++ b/src/controllers/hello_controller.js @@ -0,0 +1,7 @@ +import { Controller } from "@hotwired/stimulus" + +export default class extends Controller { + connect() { + this.element.textContent = "Hello World!" + } +} diff --git a/src/controllers/index.js b/src/controllers/index.js new file mode 100644 index 0000000..d0685d3 --- /dev/null +++ b/src/controllers/index.js @@ -0,0 +1,8 @@ +// This file is auto-generated by ./bin/rails stimulus:manifest:update +// Run that command whenever you add a new controller or create them with +// ./bin/rails generate stimulus controllerName + +import { application } from "./application" + +import HelloController from "./hello_controller" +application.register("hello", HelloController) |
