diff options
author | Matthew Lemon <y@yulqen.org> | 2023-12-17 14:26:17 +0000 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2023-12-17 14:26:17 +0000 |
commit | c84b94a647fb4c068e8be9d0495ff7284f41f168 (patch) | |
tree | d969c75c764436c0478234233597e38e1e29c2d5 /app/javascript |
Initial
Diffstat (limited to 'app/javascript')
-rw-r--r-- | app/javascript/application.js | 4 | ||||
-rw-r--r-- | app/javascript/controllers/application.js | 9 | ||||
-rw-r--r-- | app/javascript/controllers/hello_controller.js | 7 | ||||
-rw-r--r-- | app/javascript/controllers/index.js | 8 |
4 files changed, 28 insertions, 0 deletions
diff --git a/app/javascript/application.js b/app/javascript/application.js new file mode 100644 index 0000000..3016c21 --- /dev/null +++ b/app/javascript/application.js @@ -0,0 +1,4 @@ +// Entry point for the build script in your package.json +import "@hotwired/turbo-rails" +import "./controllers" +import * as bootstrap from "bootstrap" diff --git a/app/javascript/controllers/application.js b/app/javascript/controllers/application.js new file mode 100644 index 0000000..1213e85 --- /dev/null +++ b/app/javascript/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/app/javascript/controllers/hello_controller.js b/app/javascript/controllers/hello_controller.js new file mode 100644 index 0000000..5975c07 --- /dev/null +++ b/app/javascript/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/app/javascript/controllers/index.js b/app/javascript/controllers/index.js new file mode 100644 index 0000000..d0685d3 --- /dev/null +++ b/app/javascript/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) |