1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
This commit is contained in:
HParker 2021-09-27 09:22:35 -07:00
parent c7b86bc7e0
commit 55811579aa

View file

@ -1,3 +1,29 @@
* Allow permitting numeric params.
Previously it was impossible to permit different fields on numeric parameters.
After this change you can specify different fields for each numbered parameter.
For example params like,
```ruby
book: {
authors_attributes: {
'0': { name: "William Shakespeare", age_of_death: "52" },
'1': { name: "Unattributed Assistant" },
'2': "Not a hash",
'new_record': { name: "Some name" }
}
}
```
Before you could permit name on each author with,
`permit book: { authors_attributes: [ :name ] }`
After this change you can permit different keys on each numbered element,
`permit book: { authors_attributes: { '1': [ :name ], '0': [ :name, :age_of_death ] } }`
Fixes #41625
*Adam Hess*
* Update `HostAuthorization` middleware to render debug info only
when `config.consider_all_requests_local` is set to true.