Hidden companion of check box should respect the HTML5 input[form] attribute #4848

Closed
nasa42 opened this Issue Feb 2, 2012 · 0 comments

Projects

None yet

2 participants

@nasa42
nasa42 commented Feb 2, 2012
<%= fields_for @post do |f| %>
  <%= f.check_box :published, :form => "new_post" %>
<% end %>

Outputs

<input name="post[published]" type="hidden" value="0" />
<input form="new_post" id="post_published" name="post[published]" type="checkbox" value="1" />

Expected

<input form="new_post" name="post[published]" type="hidden" value="0" />
<input form="new_post" id="post_published" name="post[published]" type="checkbox" value="1" />

Tested with Rails 3.2.1
HTML5 input[form] attribute - https://developer.mozilla.org/en/HTML/Element/input#Attributes

@josevalim josevalim pushed a commit that closed this issue Feb 2, 2012
@carlosantoniodasilva carlosantoniodasilva Replicate :form html5 attribute to hidden field for check_box
When the new html5 attribute :form is given to the check_box helper, it
should be replicated to the hidden field as well. Closes #4848
3d10955
@josevalim josevalim closed this in 3d10955 Feb 2, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment