title: Using bootstrap-switch with Rails' check_box
body: <p>I need to display a checkbox for a User's field. Currently I do so using:</p>
  
  <pre><code>&lt;%= f.label :is_name_public, "Public name" %&gt;
  &lt;%= f.check_box :is_name_public %&gt;
  </code></pre>
  
  <p>Now I want to use <a href="http://www.bootstrap-switch.org/" rel="nofollow">bootstrap-switch</a> with Rails' chech_box. In order to use the switch button, the checkbox needs to be something like:</p>
  
  <p><code>&lt;input id="user_is_name_public" name="user[is_name_public]" type="checkbox" value="1"  data-size="small" data-on-color="success" data-on-text="Yes" data-off-text="No"&gt;</code></p>
  
  <p>instead of Rails' default:</p>
  
  <p><code>&lt;input id="user_is_name_public" name="user[is_name_public]" type="checkbox" value="1"&gt;</code></p>
  
  <p>The <strong>question is</strong>, how to tell Rails to add custom properties like <code>data-size="small"</code> or <code>data-on-color="success"</code> to the checkbox? Or how to associate a custom html checkbox with the entity being edited by the form?</p>