Rails form check_box_tag parameter passing in array
I am using check_box_tag in my forms with jquery-mobile stylesheeting. My form_tag with check_box_tag works without jquery-mobile, but when I start using the jquery-mobile css and javascript, check_box_tag only allows me to check one op开发者_如何学Pythontion. Here is the code:
<%= form_tag(posts_path, :multipart => true) do %>
<div data-role="fieldcontain">
<fieldset data-role="controlgroup">
<legend>Choose terms:</legend>
<%= check_box_tag name= "agreement[]", value=1, checked = false, :id => "checkbox-1" %>
<label for="checkbox-1">I agree</label>
<%= check_box_tag name= "agreement[]", value=2, checked = false, :id => "checkbox-2" %>
<label for="checkbox-2">I agree without preconditions</label>
</fieldset>
</div>
Why can't I select both checkboxes in the UI when jquery-mobile css and javascript is in use? How do I pass an array of parameters to Rails server?
精彩评论