diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-11 16:23:59 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-11 18:06:53 -0700 |
commit | 0988ad0fa799f6d97a9d906b6fa4d5dd3cb2987d (patch) | |
tree | 1906ae08dead680fd02cafc266c2d6ce61d84b21 /actionpack/lib | |
parent | e69364bc2da0cd5cabe3f01a8dce27ac841a3a2b (diff) | |
download | rails-0988ad0fa799f6d97a9d906b6fa4d5dd3cb2987d.tar.gz rails-0988ad0fa799f6d97a9d906b6fa4d5dd3cb2987d.tar.bz2 rails-0988ad0fa799f6d97a9d906b6fa4d5dd3cb2987d.zip |
pull :format up a little bit
apparently `format` can also come from the scope options, so we need to
extract it there too.
Diffstat (limited to 'actionpack/lib')
-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 6a6af41320..2b6c655d08 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -62,6 +62,8 @@ module ActionDispatch attr_reader :to, :default_controller, :default_action, :as, :anchor def self.build(scope, set, path, as, controller, default_action, to, options) + formatted = options.delete(:format) { scope[:options] && scope[:options][:format] } + options = scope[:options].merge(options) if scope[:options] options.delete :only @@ -69,13 +71,14 @@ module ActionDispatch options.delete :shallow_path options.delete :shallow_prefix options.delete :shallow + options.delete :format defaults = (scope[:defaults] || {}).dup - new scope, set, path, defaults, as, controller, default_action, scope[:module], to, options + new scope, set, path, defaults, as, controller, default_action, scope[:module], to, formatted, options end - def initialize(scope, set, path, defaults, as, controller, default_action, modyoule, to, options) + def initialize(scope, set, path, defaults, as, controller, default_action, modyoule, to, formatted, options) @requirements, @conditions = {}, {} @defaults = defaults @set = set @@ -86,7 +89,6 @@ module ActionDispatch @as = as @anchor = options.delete :anchor - formatted = options.delete :format via = Array(options.delete(:via) { [] }) options_constraints = options.delete :constraints |