September 2022
Intermediate to advanced
410 pages
10h 7m
English
We’ve already installed Stimulus as part of the stimulus-rails gem install. It’s worth mentioning that Stimulus depends on static class attributes, which are not a part of standard JavaScript. They are included in TypeScript, and in the default package that esbuild uses for JavaScript, so our Stimulus code will work without further configuration. If you are using other build tools like Babel, you’ll need to ensure that static class attributes are allowed.
The stimulus-rails installation added some JavaScript to our code base. First off, it added a line to our application.js file:
| | import "@hotwired/turbo-rails" |
| | import "./controllers" |
By calling import "./controllers", we’re ...
Read now
Unlock full access