diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-13 05:35:51 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-13 05:35:51 +0000 |
commit | 7f558cbd05535f80dfb56198c803df09896c202b (patch) | |
tree | e836c857cf6d699526253e256dbaf80659f42ea4 /actionpack | |
parent | ecf82d127bb814ff4b9b35fbf177839932d7df65 (diff) | |
download | rails-7f558cbd05535f80dfb56198c803df09896c202b.tar.gz rails-7f558cbd05535f80dfb56198c803df09896c202b.tar.bz2 rails-7f558cbd05535f80dfb56198c803df09896c202b.zip |
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
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/CHANGELOG | 2 | ||||
-rw-r--r-- | actionpack/lib/action_controller/routing.rb | 6 | ||||
-rw-r--r-- | actionpack/test/controller/routing_tests.rb | 5 |
3 files changed, 11 insertions, 2 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index a648cbcd70..4ec1701839 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Fixed that *rest parameter in map.connect couldn't accept an empty list #1037 [Dee.Zsombor@gmail.com] + * Added :confirm option to link_to_remote just like link_to has #1082 [yrashk@fp.org.ua] * Added minute_step as an option to select_minute (and the helpers that use it) to jump in larger increments than just 1 minute. At 15, it would return 0, 15, 30, 45 options #1085 [ordwaye@evergreen.edu] 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 diff --git a/actionpack/test/controller/routing_tests.rb b/actionpack/test/controller/routing_tests.rb index a5b6066d66..0f5987e69e 100644 --- a/actionpack/test/controller/routing_tests.rb +++ b/actionpack/test/controller/routing_tests.rb @@ -343,7 +343,10 @@ class RouteTests < Test::Unit::TestCase {}) end - + def test_path_empty_list + route '*a', :controller => 'content' + verify_recognize '', :controller => 'content', :a => [] + end def test_special_characters route ':id', :controller => 'content', :action => 'fish' |