Rails Bootstrap Checkboxes

Update: This was only necessary for Bootstrap 2.3.
Bootstrap 3 is working nicely without any further changes.

I wanted to move from jQuery UI buttonsets to the bootstrap framework, but found that it lacks support for simple checkboxes.

This script takes the checkboxes which are produced by rails (check_box object_name, method_name, ...) and turns them into a bootstrap button group.

The result might look like this:

Daterange selector with weekdays