On Feb 8, 1:03 pm, Luke Ivers <lukeiv... / gmail.com> wrote:
> For {:test => 'testing'} the return should be test=testing
> For {:test => {:test => 'testing'}} it should be test[test]=testing
> Any nested hashes past that point should just continue to be added on as
> an array reference:
> {:test => {:test => {:test => 'testing'}}}
> => test[test][test] = testing

So, the parent attribute is really just for the recursive calls?

Is the output of the code correct for these cases:

puts(  { :foo=> 'bar', :jim=>'jam time' }.to_params )
#=> jim=jam time&foo=bar

puts(  { :foo => { :bar=>1, :jim=>'jam' } }.to_params )
#=> foo[jim]=jam&foo[bar]=1

puts(  { :foo =>
{ :bar=>{ :jim=>'jam', :jar=>'jib' }, :jim=>'jam' } }.to_params )
#=> foo[jim]=jam&foo[bar][jim]=jam&foo[bar][jar]=jib

(Note the unencoded space in the first example.)