Skip to content

Commit 7753e24

Browse files
authored
Merge pull request rails#43318 from HParker/add-numeric-params-changelog-entry
Add changelog entry for rails#42501 [ci-skip]
2 parents c7b86bc + 5581157 commit 7753e24

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

actionpack/CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
* Allow permitting numeric params.
2+
3+
Previously it was impossible to permit different fields on numeric parameters.
4+
After this change you can specify different fields for each numbered parameter.
5+
For example params like,
6+
```ruby
7+
book: {
8+
authors_attributes: {
9+
'0': { name: "William Shakespeare", age_of_death: "52" },
10+
'1': { name: "Unattributed Assistant" },
11+
'2': "Not a hash",
12+
'new_record': { name: "Some name" }
13+
}
14+
}
15+
```
16+
17+
Before you could permit name on each author with,
18+
`permit book: { authors_attributes: [ :name ] }`
19+
20+
After this change you can permit different keys on each numbered element,
21+
`permit book: { authors_attributes: { '1': [ :name ], '0': [ :name, :age_of_death ] } }`
22+
23+
Fixes #41625
24+
25+
*Adam Hess*
26+
127
* Update `HostAuthorization` middleware to render debug info only
228
when `config.consider_all_requests_local` is set to true.
329

0 commit comments

Comments
 (0)