title: Rails 4: Custom form builder checkbox
body: <p>I have a form builder helper method:</p>
  
  <pre><code> def check_box(attribute_name, *args)
      @template.content_tag 'label', class: 'checkbox', for: "#{@object_name}_#{attribute_name}" do
        super(attribute_name, *args) + @template.content_tag('i') +
            @object.class.human_attribute_name(attribute_name)
      end
    end
  </code></pre>
  
  <p>This generates a nested HTML as:</p>
  
  <pre><code>&lt;label class="checkbox" for="application_setting_alert_on_click_link"&gt;
  &lt;input type="hidden" value="0" name="application_setting[alert_on_click_link]"&gt;
  &lt;input id="application_setting_alert_on_click_epay_link" type="checkbox" value="1" name="application_setting[alert_on_click_link]"&gt;
  &lt;i&gt;&lt;/i&gt;
  When customer visits link
  &lt;/label&gt;
  </code></pre>
  
  <p>But by W3C validator we cannot have 2 inputs inside a label hence, I want the hidden input to be taken out and placed outside the label as: </p>
  
  <pre><code>&lt;input type="hidden" value="0" name="application_setting[alert_on_click_link]"&gt;
  &lt;label class="checkbox" for="application_setting_alert_on_click_link"&gt;
      &lt;input id="application_setting_alert_on_click_epay_link" type="checkbox" value="1" name="application_setting[alert_on_click_link]"&gt;
      &lt;i&gt;&lt;/i&gt;
      When customer visits link
   &lt;/label&gt;
  </code></pre>
  
  <p>Any help?</p>