lib/whipped-cream/views/switch.erb
<div class="item">
<% pin = runner.pins[control.id] %>
<% pin_state = runner.read_pin(pin) %>
<form action="/<%= control.id %>" method="post">
<label class="ios-switch-label">
<h2><%= control.name %></h2>
<input type="hidden" name="state" value="off" />
<input type="checkbox"
name="state"
class="ios-switch"
value="on"
<%= "checked" if pin_state == :on %> />
<div></div>
</label>
<input type="submit" value="Submit">
</form>
</div>