-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rails 7.1: nested object cannot handle its parameters properly #49601
Comments
Can you create a reproduction test script using one of the templates in https://github.com/rails/rails/tree/main/guides/bug_report_templates ? |
@fatkodima I just updated the issue. And I added the test codes. When I run the test, as you can see the result is now; Fetching gem metadata from https://rubygems.org/...........
Resolving dependencies...
Run options: --seed 41159
# Running:
I, [2023-10-13T21:09:09.379388 #45765] INFO -- : Started POST "/countries" for 127.0.0.1 at 2023-10-13 21:09:09 +0300
{"name"=>"Turkey"}
.
Finished in 0.087516s, 11.4265 runs/s, 11.4265 assertions/s.
1 runs, 1 assertions, 0 failures, 0 errors, 0 skips I cannot get the metadatum_attributes parameter. When I run the 7.0.8 version, it looks like this: Fetching gem metadata from https://rubygems.org/...........
Resolving dependencies...
Run options: --seed 44
# Running:
I, [2023-10-13T21:16:41.921134 #46030] INFO -- : Started POST "/countries" for 127.0.0.1 at 2023-10-13 21:16:41 +0300
{"name"=>"Turkey", "metadatum_attributes"=>#<ActionController::Parameters {"title"=>"metadatum title", "description"=>"metadatum description"} permitted: true>}
.
Finished in 0.089626s, 11.1575 runs/s, 11.1575 assertions/s.
1 runs, 1 assertions, 0 failures, 0 errors, 0 skips Am I doing something wrong? thanks. |
Thanks. I see some garbage in |
I debugged, that this started to fail after #47133 gets merged into Rails. That PR updates requirement to Rack 3. I believe, that your example worked before because of some "unexpected behaviour" via regexp parsing that led to that "feature". But you should really use a hash in your tests, like the commented section from your reproduction script # metadatum_attributes: {
# title: "metadatum title",
# description: "metadatum description"
# } and for curl use cc @jeremyevans |
This is basically the same as rack/rack#2128. The general opinion of Rack maintainers is that using |
Steps to reproduce
Rails 7.1 cannot properly handle parameters from multipart/formdata requests.
Expected behavior
Actual behavior
It was working smoothly in version 7.0.8. However, after the 7.1.0 update, it gives this error on the console.
System configuration
Rails version: 7.1.1
Ruby version: 3.2.2
The text was updated successfully, but these errors were encountered: