From: Dave Garcia Date: 2009-06-05T17:15:03+09:00 Subject: Re: Nested HTTP params on ruby HTTP requests Hi Brian, you're not lost I explained myself terrible, my fault ;). Those example of serializations are produced by my code. I tested it only sending post request vs rails, but it worked fine with all proposed examples. Sorry for by bad explanation. Best regards Dave Brian Candler wrote: > Dave Garcia wrote: >> On the client side: >> >> params = {:a=>[{:d=>:e, :b=>:c}]} >> serialize_form_data(params) # "a[][d]=e&a[][b]=c" >> >> On the server side Rails 2.3.2 works fine deserializing my params are : >> >> {"a"=>[{"b"=>"c", "d"=>"e"}], "action"=>"show", >> "controller"=>"identities"} > > Then I've lost you, because that all seems to be working fine (both > serialize_form_data and RoR deserializing it) > > So can you give an example of what the problem actually is? > >> But when values are hashes serialization doesn't work as expected. >> >> For example >> { :a => [{:b => :c}, {:d => :e}]} => "a[][b]=c&a[][d]=e" > > Maybe I misunderstood this. Is this what your code actually produces, or > what you expected it to produce? If not, what did you expect it to > produce? -- Posted via http://www.ruby-forum.com/.