Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
nasa42 opened this Issue · 0 comments

2 participants

Vikrant Chaudhary José Valim
Vikrant Chaudhary
<%= 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

José Valim josevalim closed this issue from a commit
Carlos Antonio da Silva 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
José Valim josevalim closed this in 3d10955
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.