diff options
-rw-r--r-- | actionpack/lib/action_controller/routing.rb | 1 | ||||
-rw-r--r-- | actionpack/test/controller/routing_test.rb | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/routing.rb b/actionpack/lib/action_controller/routing.rb index 64657a3821..f8ca5e0930 100644 --- a/actionpack/lib/action_controller/routing.rb +++ b/actionpack/lib/action_controller/routing.rb @@ -363,6 +363,7 @@ module ActionController use_recall = true controller = options[:controller] + options[:action] ||= 'index' if controller recall_controller = recall[:controller] if (recall_controller && recall_controller.include?(?/)) || (controller && controller.include?(?/)) recall = {} if controller && controller[0] == ?/ diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index 1243b0a6a9..16e9baf6e8 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -689,10 +689,14 @@ class RouteSetTests < Test::Unit::TestCase rs.connect ':controller/:action/:id' end - assert_equal ['/page/20', {}], rs.generate(:controller => 'pages', :id => 20) + assert_equal ['/page/20', {}], rs.generate({:id => 20}, {:controller => 'pages'}) assert_equal ['/page/20', {}], rs.generate(:controller => 'pages', :id => 20, :action => 'show') assert_equal ['/pages/boo', {}], rs.generate(:controller => 'pages', :action => 'boo') end + + def test_action_expiry + assert_equal ['/content', {}], rs.generate({:controller => 'content'}, {:controller => 'content', :action => 'show'}) + end end end |