Skip to content

Support for integers as array values #1

Merged
merged 2 commits into from May 22, 2012

2 participants

@jrust
jrust commented May 21, 2012

I was having an issue where a hash like the following:

{ some_key: [1, 2, 3] }

Was producing code with empty values:

<input name="some_key[]" value="" />

Finally tracked it down to Rack::Utils.build_nested_query not supporting integers. This commit adds a test for the integer behavior and switches to using ActiveSupports' #to_query which is what url_for uses for building up the query string.

@jrust
jrust commented May 21, 2012

Also just added support for rejecting keys whose value is nil which is something else url_for does.

@brianhempel brianhempel merged commit 7f0dec6 into brianhempel:master May 22, 2012
@brianhempel
Owner

Looks good, merged and pushed v2.0.0. Thanks a bunch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.