Params is saved like HashWithIndifferentAccess

rails

#1

Hi I have an application in rails 3. I have a field birthplace that have multiple value city in italy and city in german and i store all in one field. So this is my html

<input  type="text" size="25" name="person[birthplace[it]]"
id="person_birthplace[it]" value="" >

<input  type="text" size="25" name="person[birthplace[de]]"
id="person_birthplace[de]" value="" >

so my params are

{"utf8"=>"✓",
"authenticity_token"=>"RvpwQw/RdTAT2d4jtaSyBAYRgT1mKgWg9kyrS7pUnMo=",
"person"=>{"birthplace"=>{"it"=>"Padova", "de"=>"Padovan"}},
"commit"=>"Create Person", "action"=>"create", "controller"=>"people"}

but the data is stored in the field birthplace like

--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\nit: Padova\nde:
Padovan\n

if i put in my model

serialize :birthplace, Hash

the data is stored correctly but with default serialization that i think is yaml not working and i have HashWithIndifferentAccess why?

I want to save like

---\nit: Padova\nde: Padovan\n


#2

@arrayjumper69610,
Have you tried using

 =person[:birthplace][:it]
 =person['birthplace']['de']

#3

Thank, but is not the solution..I search a method to store multiple param like string in this format

---\nit: Padova\nde: Padovan\n

but now i have the error

--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess and not in hash format