I've been playing with JQuery Mobile and Rails and I had a problem with a checkbox not working properly. The checkbox would render properly but wouldn't update my model. My checkbox was rendered within the erb template with the following snippet…
<p><code><br/>
<div data-role="fieldcontain">
<fieldset data-role="controlgroup">
<%= f.label :interviewer %>
<%= f.check_box :interviewer %>
</fieldset><br/>
</div><br/></code></p>
It turns out i had the label and checkbox in the incorrect order.
<div data-role="fieldcontain">
<fieldset data-role="controlgroup">
<%= f.check_box :interviewer %>
<%= f.label :interviewer %>
</fieldset>
</div>
Comments