From e17df19b86a2ad0ed8c5657ef046c3e82cf6d63b Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Tue, 6 Mar 2007 07:47:23 +0000 Subject: 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 --- activesupport/lib/active_support/core_ext/hash/conversions.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'activesupport') 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 = {}) -- cgit v1.2.3