aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/form_helpers.md
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2013-07-08 17:15:26 +0900
committerAkira Matsuda <ronnie@dio.jp>2013-07-08 17:21:25 +0900
commit19df76f75e24851b9073d6dab637f235fab69ae4 (patch)
tree0eb643b9eaf24d5daf59642f6ada464ed2421f76 /guides/source/form_helpers.md
parentb18a27375a62b7c9848cd2dc7b5cf152ef61b62f (diff)
downloadrails-19df76f75e24851b9073d6dab637f235fab69ae4.tar.gz
rails-19df76f75e24851b9073d6dab637f235fab69ae4.tar.bz2
rails-19df76f75e24851b9073d6dab637f235fab69ae4.zip
params keys are Strings
Diffstat (limited to 'guides/source/form_helpers.md')
-rw-r--r--guides/source/form_helpers.md26
1 files changed, 13 insertions, 13 deletions
diff --git a/guides/source/form_helpers.md b/guides/source/form_helpers.md
index 7f37a298b1..11e8db9e88 100644
--- a/guides/source/form_helpers.md
+++ b/guides/source/form_helpers.md
@@ -553,7 +553,7 @@ outputs (with actual option values omitted for brevity)
which results in a `params` hash like
```ruby
-{:person => {'birth_date(1i)' => '2008', 'birth_date(2i)' => '11', 'birth_date(3i)' => '22'}}
+{'person' => {'birth_date(1i)' => '2008', 'birth_date(2i)' => '11', 'birth_date(3i)' => '22'}}
```
When this is passed to `Person.new` (or `update`), Active Record spots that these parameters should all be used to construct the `birth_date` attribute and uses the suffixed information to determine in which order it should pass these parameters to functions such as `Date.civil`.
@@ -881,19 +881,19 @@ end
```ruby
{
- :person => {
- :name => 'John Doe',
- :addresses_attributes => {
- '0' => {
- :kind => 'Home',
- :street => '221b Baker Street',
- },
- '1' => {
- :kind => 'Office',
- :street => '31 Spooner Street'
- }
- }
+ 'person' => {
+ 'name' => 'John Doe',
+ 'addresses_attributes' => {
+ '0' => {
+ 'kind' => 'Home',
+ 'street' => '221b Baker Street'
+ },
+ '1' => {
+ 'kind' => 'Office',
+ 'street' => '31 Spooner Street'
+ }
}
+ }
}
```