You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The use case here is to create parameters that contain an array in bar which consists of hashes containing id keys.
Current behavior
This produces inputs with names like this: foo[bar[][id]] which is no longer supported by rack see rack/rack#2128
The resulting parameters look like this:
"foo"=>{"bar["=>{"id"=>{"]"=>"33"}}}
Maybe this is not the intended way to create query params that contain an array containing hashes?
I tried using simple_fields_for but I could not make it work
related to heartcombo/simple_form#1834
The previous html for editing a setting looked like this:
<input class="string optional form--medium enhanced" type="text" name="setting[setting[36086]][value]" id="setting_setting_70243__value">
it now looks like:
<input value="Job position" class="string required form--medium enhanced" type="text" name="setting[setting_36086][value]" id="setting_setting_36086_value">
related to heartcombo/simple_form#1834
The previous html for editing a setting looked like this:
<input class="string optional form--medium enhanced" type="text" name="setting[setting[36086]][value]" id="setting_setting_70243__value">
it now looks like:
<input value="Job position" class="string required form--medium enhanced" type="text" name="setting[setting_36086][value]" id="setting_setting_36086_value">
sobakasu
added a commit
to katalyst/koi
that referenced
this issue
Mar 7, 2024
related to heartcombo/simple_form#1834
The previous html for editing a setting looked like this:
<input class="string optional form--medium enhanced" type="text" name="setting[setting[36086]][value]" id="setting_setting_70243__value">
it now looks like:
<input value="Job position" class="string required form--medium enhanced" type="text" name="setting[setting_36086][value]" id="setting_setting_36086_value">
Environment
Hey, there.
Rack changed how they parse query parameters which causes the usage of multiple inputs of the same name to generate unparseable query parameters.
Here is a quick example:
The use case here is to create parameters that contain an array in bar which consists of hashes containing id keys.
Current behavior
This produces inputs with names like this:
foo[bar[][id]]
which is no longer supported by rack see rack/rack#2128The resulting parameters look like this:
"foo"=>{"bar["=>{"id"=>{"]"=>"33"}}}
Maybe this is not the intended way to create query params that contain an array containing hashes?
I tried using
simple_fields_for
but I could not make it workExpected behavior
I think the names generated by a form like this should follow the conventions mentioned by rails: https://guides.rubyonrails.org/form_helpers.html#understanding-parameter-naming-conventions
thus generating names like this:
foo[bar][][id]
Current Workaround
Simply setting the name manually by adding
input_html: { name: '...' }
BTW:
If anyone could point out where this is implemented I am happy to create a PR but I currently don't have the time to dig this myself.
The text was updated successfully, but these errors were encountered: