aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/url_rewriter.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/url_rewriter.rb b/actionpack/lib/action_controller/url_rewriter.rb
index 7bf9015b37..fa003119ec 100644
--- a/actionpack/lib/action_controller/url_rewriter.rb
+++ b/actionpack/lib/action_controller/url_rewriter.rb
@@ -174,7 +174,12 @@ module ActionController
elements = []
query_string = ""
- hash.each { |key, value| elements << "#{CGI.escape(key)}=#{CGI.escape(value.to_s)}" }
+ hash.each do |key, value|
+ key = CGI.escape key
+ key += '[]' if value.class == Array
+ value = [ value ] unless value.class == Array
+ value.each { |val| elements << "#{key}=#{CGI.escape(val.to_s)}" }
+ end
unless elements.empty? then query_string << ("?" + elements.join("&")) end
return query_string