crumble-stimulus

Seamless integration of stimulus.cr into crumble

crumble-stimulus

Seamless integration of stimulus.cr into crumble, providing a JS module that automatically includes all your Stimulus::Controllers and can be easily added to your template.

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      crumble-stimulus:
        github: sbsoftware/crumble-stimulus
    
  2. 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/*"

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
  • about 1 month ago
  • December 1, 2023
License

MIT License

Links
Synced at

Tue, 21 Jan 2025 03:54:08 GMT

Languages