crumble-stimulus
crumble-stimulus
Seamless integration of stimulus.cr into crumble, providing a JS module that includes all your Stimulus::Controllers that is automatically added to your layout template.
Installation
-
Add the dependency to your
shard.yml:dependencies: crumble-stimulus: github: sbsoftware/crumble-stimulus -
Run
shards install
Usage
# make sure this comes before you require any controllers you want to include,
# otherwise they'll be missing
require "crumble-stimulus"
# or wherever your Stimulus controllers are
require "./stimulus_controllers/*"
The Crumble::StimulusControllers script is automatically added to any template inheriting from the generic ToHtml::Layout.
Custom Layout
If you don't use a layout based on ToHtml::Layout, you'll have to include the Crumble::StimulusControllers script manually:
html do
head do
# [...]
Crumble::StimulusControllers
# [...]
end
end
Repository
crumble-stimulus
Owner
Statistic
- 0
- 0
- 0
- 2
- 3
- 8 months ago
- December 1, 2023
License
MIT License
Links
Synced at
Wed, 12 Nov 2025 21:53:39 GMT
Languages