Skip to content
A simple asset-pipeline wrapper for Stimulus.js by Brice Sanchez
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
vendor/assets/javascripts
.gitignore
Gemfile
LICENSE.md
Rakefile
Readme.md
stimulusjs-rails.gemspec

Readme.md

stimulusjs-rails

Gem Gem

About

Rails 4.2+ asset-pipeline gem to provide Stimulus.js

Package Versions

  • Stimulus 1.1.1
  • Stimulus 1.0.1

Setup

Have in your Gemfile:

gem 'stimulusjs-rails', '~> 1.1.1'

And in your application.js manifest:

//= require stimulus

window.application = Stimulus.Application.start()

Example

Add in your application.js

//= require controllers/hello_controller

and in controllers/hello_controller.es6

window.application.register('hello', class extends Stimulus.Controller {
  static get targets() {
    return [ "name" ]
  }

  //
})

Tips

See this for Sprocket + ES6 support: https://github.com/rails/sprockets#es6-support

Contributing

Contributions are welcome, please follow GitHub Flow

License

MIT

You can’t perform that action at this time.