Skip to content

Commit d83f52c

Browse files
Fixed form helper documentation [ci-skip]
1 parent 90a272a commit d83f52c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

guides/source/form_helpers.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -870,10 +870,10 @@ Which will result in a `params` hash that looks like:
870870
```
871871

872872
All of the form inputs map to the `"person"` hash because we called `fields_for`
873-
on the `person_form` form builder. By specifying an `:index` option, we mapped
874-
the address inputs to `person[address][#{address.id}][city]` instead of
875-
`person[address][city]`. Thus we are able to determine which Address records
876-
should be modified when processing the `params` hash.
873+
on the `person_form` form builder. Also, by specifying `index: address.id`, we
874+
rendered the `name` attribute of each city input as `person[address][#{address.id}][city]`
875+
instead of `person[address][city]`. Thus we are able to determine which Address
876+
records should be modified when processing the `params` hash.
877877

878878
You can pass other numbers or strings of significance via the `:index` option.
879879
You can even pass `nil`, which will produce an array parameter.

0 commit comments

Comments
 (0)