diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-03-06 07:47:23 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-03-06 07:47:23 +0000 |
commit | e17df19b86a2ad0ed8c5657ef046c3e82cf6d63b (patch) | |
tree | 6be3fd7d147287fd6410b209d3f01e3fa056e423 /activesupport | |
parent | 2b7dbad8e081b1ce84a7262b1b0953254bf8f651 (diff) | |
download | rails-e17df19b86a2ad0ed8c5657ef046c3e82cf6d63b.tar.gz rails-e17df19b86a2ad0ed8c5657ef046c3e82cf6d63b.tar.bz2 rails-e17df19b86a2ad0ed8c5657ef046c3e82cf6d63b.zip |
Allow array and hash query parameters. Array route parameters are converted/to/a/path as before. References #6765, #7462. Closes #7047.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6343 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/core_ext/hash/conversions.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/core_ext/hash/conversions.rb b/activesupport/lib/active_support/core_ext/hash/conversions.rb index d3ab3b3590..1cdf7d5c54 100644 --- a/activesupport/lib/active_support/core_ext/hash/conversions.rb +++ b/activesupport/lib/active_support/core_ext/hash/conversions.rb @@ -9,13 +9,13 @@ class Object end def to_query(key) #:nodoc: - "#{CGI.escape(key.to_s)}=#{CGI.escape(to_param || "")}" + "#{CGI.escape(key.to_s)}=#{CGI.escape(to_param.to_s)}" end end class Array def to_query(key) #:nodoc: - collect { |value| value.to_query("#{key}[]") } * '&' + collect { |value| value.to_query("#{key}[]") }.sort * '&' end end @@ -48,7 +48,7 @@ module ActiveSupport #:nodoc: def to_query(namespace = nil) collect do |key, value| value.to_query(namespace ? "#{namespace}[#{key}]" : key) - end * '&' + end.sort * '&' end def to_xml(options = {}) |