File tree Expand file tree Collapse file tree 5 files changed +24
-0
lines changed Expand file tree Collapse file tree 5 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 11// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
2+ import "controllers"
Original file line number Diff line number Diff line change 1+ import { Application } from "@hotwired/stimulus"
2+
3+ const application = Application . start ( )
4+
5+ // Configure Stimulus development experience
6+ application . debug = false
7+ window . Stimulus = application
8+
9+ export { application }
Original file line number Diff line number Diff line change 1+ import { Controller } from "@hotwired/stimulus"
2+
3+ export default class extends Controller {
4+ connect ( ) {
5+ this . element . textContent = "Hello World!"
6+ }
7+ }
Original file line number Diff line number Diff line change 1+ // Import and register all your controllers from the importmap via controllers/**/*_controller
2+ import { application } from "controllers/application"
3+ import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading"
4+ eagerLoadControllersFrom ( "controllers" , application )
Original file line number Diff line number Diff line change 11# Pin npm packages by running ./bin/importmap
22
33pin "application"
4+ pin "@hotwired/stimulus" , to : "stimulus.min.js"
5+ pin "@hotwired/stimulus-loading" , to : "stimulus-loading.js"
6+ pin_all_from "app/javascript/controllers" , under : "controllers"
You can’t perform that action at this time.
0 commit comments