Foundation 5 Switches with simple_form gem

Viewed 1107

I am trying to achieve a result not too similar to this http://foundation.zurb.com/docs/components/switch.html? using Foundation 5 switch class

The issue I'm having is that simple_form creates a hidden input with the same name so when I use the following code I don't achieve the desired result

= simple_form_for(@team_setting) do |f|
  = f.error_notification
  .form-inputs
    .switch
      = f.label :arrive_time, 'On'
      = f.input_field :arrive_time, boolean_style: :inline
      %span

I fairly much get the below HTML produced

<div class="switch">
    <label for="team_setting_arrive_time">On</label>
    <input name="team_setting[arrive_time]" type="hidden" value="0"><input boolean_style="inline" class="boolean optional" id="team_setting_arrive_time" name="team_setting[arrive_time]" type="checkbox" value="1">
    <span></span>
</div>
0 Answers
Related