File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -870,10 +870,10 @@ Which will result in a `params` hash that looks like:
870
870
```
871
871
872
872
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.
877
877
878
878
You can pass other numbers or strings of significance via the ` :index ` option.
879
879
You can even pass ` nil ` , which will produce an array parameter.
You can’t perform that action at this time.
0 commit comments