Matthew Phelan
3 years ago
6 changed files with 30 additions and 4 deletions
@ -0,0 +1,7 @@ |
|||||||
|
import { Controller } from "@hotwired/stimulus" |
||||||
|
|
||||||
|
export default class extends Controller { |
||||||
|
connect() { |
||||||
|
this.element.textContent = "Hello World!" |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,14 @@ |
|||||||
|
import { Application } from "@hotwired/stimulus" |
||||||
|
|
||||||
|
const application = Application.start() |
||||||
|
|
||||||
|
// Configure Stimulus development experience
|
||||||
|
application.warnings = true |
||||||
|
application.debug = false |
||||||
|
window.Stimulus = application |
||||||
|
|
||||||
|
// Import and register all your controllers within this directory and all subdirectories
|
||||||
|
// Controller files must be named *_controller.js or *_controller.ts
|
||||||
|
import { definitionsFromContext } from "@hotwired/stimulus" |
||||||
|
const context = require.context("controllers", true, /_controller\.(js|ts)$/) |
||||||
|
application.load(definitionsFromContext(context)) |
@ -1,4 +1,5 @@ |
|||||||
<%= form_with url:'/test', builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %> |
<%= turbo_frame_tag "form" %> |
||||||
|
<%= form_with url:'/test', builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %> |
||||||
<%= f.govuk_number_field :age, label: { text: "Age" } %> |
<%= f.govuk_number_field :age, label: { text: "Age" } %> |
||||||
<%= f.govuk_submit %> |
<%= f.govuk_submit %> |
||||||
<% end %> |
<% end %> |
||||||
|
Loading…
Reference in new issue