On Rails 7, I have noticed that whether I use a Stimulus controller or simply add the code in application.js, the Javascript code gets executed.
This is not a huge surprise but is there a way to defer the loading/execution to implement something similar to this?
<script src="demo_defer.js" defer></script>