crumble-stimulus
crumble-stimulus
Seamless integration of stimulus.cr into crumble, providing a JS module that automatically includes all your Stimulus::Controller
s and can be easily added to your template.
Installation
-
Add the dependency to your
shard.yml
:dependencies: crumble-stimulus: github: sbsoftware/crumble-stimulus
-
Run
shards install
Usage
# or wherever your Stimulus controllers are
require "./stimulus_controllers/*"
# make sure this comes after you required all controllers you want to include, otherwise they'll be missing
require "crumble-stimulus"
In your template:
html do
head do
# [...]
script Crumble::StimulusControllers
# [...]
end
end
And that's it!
Repository
crumble-stimulus
Owner
Statistic
- 0
- 0
- 0
- 2
- 2
- 8 months ago
- December 1, 2023
License
MIT License
Links
Synced at
Mon, 18 Nov 2024 01:24:09 GMT
Languages