From 7f558cbd05535f80dfb56198c803df09896c202b Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 13 Apr 2005 05:35:51 +0000 Subject: Fixed that *rest parameter in map.connect couldn't accept an empty list #1037 [Dee.Zsombor@gmail.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1158 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/routing.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_controller/routing.rb') diff --git a/actionpack/lib/action_controller/routing.rb b/actionpack/lib/action_controller/routing.rb index 406c6acb75..f0003e9974 100644 --- a/actionpack/lib/action_controller/routing.rb +++ b/actionpack/lib/action_controller/routing.rb @@ -119,7 +119,11 @@ module ActionController options[:controller] = controller_class.controller_path return nil, requirements_for(:controller) unless passes_requirements?(:controller, options[:controller]) elsif /^\*/ =~ item.to_s - value = components.empty? ? @defaults[item].clone : components.clone + if components.empty? + value = @defaults.has_key?(item) ? @defaults[item].clone : [] + else + value = components.clone + end value.collect! {|c| CGI.unescape c} components = [] def value.to_s() self.join('/') end -- cgit v1.2.3