Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sbsoftware/crumble-stimulus
Seamless integration of stimulus.cr into crumble
https://github.com/sbsoftware/crumble-stimulus
Last synced: about 2 months ago
JSON representation
Seamless integration of stimulus.cr into crumble
- Host: GitHub
- URL: https://github.com/sbsoftware/crumble-stimulus
- Owner: sbsoftware
- License: mit
- Created: 2023-12-01T21:24:11.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-29T15:32:32.000Z (2 months ago)
- Last Synced: 2024-11-29T16:29:08.968Z (2 months ago)
- Language: Crystal
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# crumble-stimulus
Seamless integration of [stimulus.cr](https://github.com/sbsoftware/stimulus.cr) into [crumble](https://github.com/sbsoftware/crumble), providing a JS module that automatically includes all your `Stimulus::Controller`s and can be easily added to your template.
## Installation
1. Add the dependency to your `shard.yml`:
```yaml
dependencies:
crumble-stimulus:
github: sbsoftware/crumble-stimulus
```2. Run `shards install`
## Usage
```crystal
# 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/*"
```In your template:
```crystal
html do
head do
# [...]
script Crumble::StimulusControllers
# [...]
end
end
```And that's it!