aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack')
-rwxr-xr-xactionpack/lib/action_controller/cgi_ext/cgi_methods.rb20
1 files changed, 11 insertions, 9 deletions
diff --git a/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb b/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb
index cd70836c6e..776f74a100 100755
--- a/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb
+++ b/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb
@@ -80,15 +80,17 @@ class CGIMethods #:nodoc:
private
def self.dasherize_keys(params)
- case params.class.to_s
- when "Hash"
- params.inject({}) do |h,(k,v)|
- h[k.tr("-", "_")] = dasherize_keys(v)
- h
- end
- else
- params
- end
+ case params.class.to_s
+ when "Hash"
+ params.inject({}) do |h,(k,v)|
+ h[k.to_s.tr("-", "_")] = dasherize_keys(v)
+ h
+ end
+ when "Array"
+ params.map { |v| dasherize_keys(v) }
+ else
+ params
+ end
end
# Splits the given key into several pieces. Example keys are 'name', 'person[name]',