Skip to content
This repository has been archived by the owner. It is now read-only.
How to listen to bootstraps jQuery events in Stimulus
Ruby HTML JavaScript CSS
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.
app
bin
config
db
lib
log
public
storage
test
tmp
vendor
.browserslistrc
.gitignore
.ruby-version
Gemfile
Gemfile.lock
Procfile
README.md
Rakefile
app.json
babel.config.js
config.ru
package.json
postcss.config.js
yarn.lock

README.md

Deploy

Bootstrap And Stimulus Example

Bootstrap uses jQuery's trigger method for proving callbacks for events, unfortunately this mean Stimulus can't listen for them using data-action.

This demos a solution that allows for the events to be listened to by a Stimulus controller.

Key files

Setting up locally

Pull down the repo & run:

./bin/setup
  • bin/setup - runs bundler & yarn, then sets up the database.

Next you should be able to run:

rails s

To turn on the server, your port may vary but if you visit http://localhost:3000/ you should be able to see the modal with a counter that updates every time it's opened.

You can’t perform that action at this time.