aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/form_helpers.textile
diff options
context:
space:
mode:
authorMike Gunderloy <MikeG1@larkfarm.com>2009-03-24 20:06:59 -0500
committerMike Gunderloy <MikeG1@larkfarm.com>2009-03-24 20:06:59 -0500
commitfab9d3b59dc87faec96aa01ce89402a9c3e57df8 (patch)
treefc40fe92aac64a926ba5edd868a031b28f320c61 /railties/guides/source/form_helpers.textile
parent4e27ca4c28432cd735a8ccb82bbaff37941a9d3b (diff)
parent0e6b9695aff6500ad48c4dd9ab61343d7090b030 (diff)
downloadrails-fab9d3b59dc87faec96aa01ce89402a9c3e57df8.tar.gz
rails-fab9d3b59dc87faec96aa01ce89402a9c3e57df8.tar.bz2
rails-fab9d3b59dc87faec96aa01ce89402a9c3e57df8.zip
Merge branch 'master' of git@github.com:lifo/docrails
Conflicts: railties/guides/source/2_3_release_notes.textile
Diffstat (limited to 'railties/guides/source/form_helpers.textile')
-rw-r--r--railties/guides/source/form_helpers.textile2
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/guides/source/form_helpers.textile b/railties/guides/source/form_helpers.textile
index 9ab4deff4e..22d24b0903 100644
--- a/railties/guides/source/form_helpers.textile
+++ b/railties/guides/source/form_helpers.textile
@@ -683,7 +683,7 @@ This would result in +params[:addresses]+ being an array of hashes with keys +li
There's a restriction, however, while hashes can be nested arbitrarily, only one level of "arrayness" is allowed. Arrays can be usually replaced by hashes, for example instead of having an array of model objects one can have a hash of model objects keyed by their id, an array index or some other parameter.
-WARNING: Array parameters do not play well with the +check_box+ helper. According to the HTML specification unchecked checkboxes submit no value. However it is often convenient for a checkbox to always submit a value. The +check_box+ helper fakes this by creating a second hidden input with the same name. If the checkbox is unchecked only the hidden input is submitted and if it is checked then both are submitted but the value submitted by the checkbox takes precedence. When working with array parameters this duplicate submission will confuse Rails since duplicate input names are how it decides when to start a new array element. It is preferable to either use +check_box_tag+ or to use hashes instead of arrays.
+WARNING: Array parameters do not play well with the +check_box+ helper. According to the HTML specification unchecked checkboxes submit no value. However it is often convenient for a checkbox to always submit a value. The +check_box+ helper fakes this by creating an auxiliary hidden input with the same name. If the checkbox is unchecked only the hidden input is submitted and if it is checked then both are submitted but the value submitted by the checkbox takes precedence. When working with array parameters this duplicate submission will confuse Rails since duplicate input names are how it decides when to start a new array element. It is preferable to either use +check_box_tag+ or to use hashes instead of arrays.
h4. Using Form Helpers