I have the array
params[:search][:cars]
which contains
"search"=>{"cars"=>["11", "7"]}
this array I am trying to put into the hidden of a form field (this block of code is in the helper method):
...
data += hidden_field_tag 'search[cars]', params[:search][:cars]
...
return data.html_safe
and this form after sending gives me:
"search"=>{"cars"=>"[\"11\", \"7\"]"}
I would like to ask you about the help, how can I send an array through the hidden input.
Thank you
In a view (adapt it to use in your helper) you can write: