#401 √ resolved
spicyj

to_params broken for Arrays

Reported by spicyj | July 16th, 2008 @ 01:25 AM | in 0.9.5

Currently,

Merb::Request.query_parse("people[][a]=1&people[][b]=2")
#=> {"people"=>[{"a"=>"1"}, {"b"=>"2"}]}

{"people"=>[{"a"=>"1"}, {"b"=>"2"}]}.to_params
#=> "people=a1b2"

Obviously this can't be the correct behaviour.

Although, I'd like also for this, like Rails does:

Merb::Request.query_parse("people[0][a]=1&people[0][b]=2&people[1][a]=3&people[1][b]=4")
#=> {"people"=>[{"a"=>"1", "b"=>"2"}, {"a"=>"1", "b"=>"2"}]}

Comments and changes to this ticket

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins