diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-11 13:38:51 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-11 14:49:18 -0700 |
commit | 934bdf672466c789f4c9725f09e1ef2e7aae6694 (patch) | |
tree | 754543745c64b15cff7acd4e1619c133037519f6 | |
parent | 97bbde76009daa7f4ebdf8a59943cfbbebe4da04 (diff) | |
download | rails-934bdf672466c789f4c9725f09e1ef2e7aae6694.tar.gz rails-934bdf672466c789f4c9725f09e1ef2e7aae6694.tar.bz2 rails-934bdf672466c789f4c9725f09e1ef2e7aae6694.zip |
push `action` option extraction up one frame.
-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 |