diff options
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 333e6a0c9f..92e32ac29b 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -72,17 +72,19 @@ module ActionDispatch defaults = (scope[:defaults] || {}).dup - new scope, set, path, defaults, as, controller, options + default_action = options.delete(:action) || scope[:action] + + new scope, set, path, defaults, as, controller, default_action, options end - def initialize(scope, set, path, defaults, as, controller, options) + def initialize(scope, set, path, defaults, as, controller, default_action, options) @requirements, @conditions = {}, {} @defaults = defaults @set = set @to = options.delete :to @default_controller = controller - @default_action = options.delete(:action) || scope[:action] + @default_action = default_action @as = as @anchor = options.delete :anchor |