Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bricesanchez/stimulusjs-rails
A simple asset-pipeline wrapper for Stimulus.js by Brice Sanchez
https://github.com/bricesanchez/stimulusjs-rails
es6 rails sprockets stimulusjs
Last synced: 21 days ago
JSON representation
A simple asset-pipeline wrapper for Stimulus.js by Brice Sanchez
- Host: GitHub
- URL: https://github.com/bricesanchez/stimulusjs-rails
- Owner: bricesanchez
- License: mit
- Created: 2018-03-11T03:46:02.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-15T14:18:28.000Z (almost 6 years ago)
- Last Synced: 2024-12-14T00:50:19.013Z (about 1 month ago)
- Topics: es6, rails, sprockets, stimulusjs
- Language: Ruby
- Size: 29.3 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE.md
Awesome Lists containing this project
README
# stimulusjs-rails
[![Gem](https://img.shields.io/gem/v/stimulusjs-rails.svg)](https://rubygems.org/gems/stimulusjs-rails)
[![Gem](https://img.shields.io/gem/dt/stimulusjs-rails.svg)](https://rubygems.org/gems/stimulusjs-rails)## 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`:
```ruby
gem 'stimulusjs-rails', '~> 1.1.1'
```And in your `application.js` manifest:
```js
//= require stimuluswindow.application = Stimulus.Application.start()
```## Example
Add in your `application.js`
```js
//= require controllers/hello_controller
```and in `controllers/hello_controller.es6`
```js
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](https://guides.github.com/introduction/flow/index.html)
## License
[MIT](LICENSE.md)