This project is archived and is in readonly mode.
check_box_tag should behave like radio_button_tag
-
Jacek Becela
- Tag changed from actionpack, action_view, edge, forms to actionpack, action_view, edge, forms, patch, tested
- Take a look at this (typical habtm scenario with checkboxes):
Now:
check_box_tag "user[neighborhood_ids][]", neighborhood.id, current_user.neighborhoods.include?(neighborhood), :id => "user_neighborhood_id_#{neighborhood.id}"With patch applied (notice I didn't need to specify my custom :id):
check_box_tag "user[neighborhood_ids][]", neighborhood.id, current_user.neighborhoods.include?(neighborhood) -
Jacek Becela
A second time today my +1 gets eaten. I forgot not to begin a sentence with a plus :)
-
Frederick Cheung
It would however break backwards compatibility (and in a way that is unlike to be covered by your application's tests), eg if you had
<%= check_box_tag 'foo', '1' %> <%= observe_field 'foo' %>Although the simplification of the example in the first comment is nice.
-
Pratik
- Assigned user set to Pratik
- State changed from new to incomplete
I think this change needs to be discussed in the mailing list first. Also, it's probably better to commit it after 2.3 is released/branched.
Thanks !
