rails: check_box :disabled => true doesn't work as expected in Rails 3.0.7 or 3.0.9
In the case of:
<%= fields_for some_model[some_new_model], foo do |form| %>
<%= form.check_box :bar, :disabled => true %>
<% end %>
Correctly generates a disabled checkbox for this field; but the automatically generated hidden form field is not disabled as one would expect.
About this issue
- Original URL
- State: closed
- Created 13 years ago
- Comments: 30 (16 by maintainers)
Commits related to this issue
- check_box helper with :disabled => true generates disabled hidden field. fixes #1953 — committed to carlosantoniodasilva/rails by deleted user 12 years ago
- Disable hidden input for disabled checkboxes When a checkbox is disabled, it doesn't send its value when the form is submitted - but the hidden input DOES. The result is that a disabled checkbox will... — committed to al2o3cr/phoenix_html by deleted user 4 years ago
Hehe: I’m up to it, just not sure when I’ll have the time soon 😉
I’ll see how I get on and revisit if it’s taking me too long to get to.