Skip to content Skip to sidebar Skip to footer

Bootstrap Switch Event Handler Not Working

I asked a question similar to this one here but now I'm stuck on using Bootstrap Switch's event handler. I want to just print out the state when the switch gets toggled. Currently

Solution 1:

The event is not being triggered due to the version of bootstrap-switch. Version 2 does not include them and the gem currently only supports Version 2. I've submitted a pull request to update the gem to version 3 (still being developed).

Branch w/ Version 3: https://github.com/tomprats/bootstrap-switch-rails/tree/allow-switch-v3

Pull request: https://github.com/manuelvanrijn/bootstrap-switch-rails/pull/9

Usage

Update your Gemfile to use the correct branch:

gem "bootstrap-switch-rails", git: "git://github.com/tomprats/bootstrap-switch-rails, branch: "allow-switch-v3"

Update your Application.js file:

//= require bootstrap-switch3

Update your Application.css file:

*= require bootstrap-switch3

Or Application.css.scss file:

@import"bootstrap-switch3";

Post a Comment for "Bootstrap Switch Event Handler Not Working"