diff options
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
| -rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 12 | 
1 files changed, 10 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 3c58a2cfc3..288ce3e867 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -11,8 +11,8 @@ module ActionDispatch      class Mapper        URL_OPTIONS = [:protocol, :subdomain, :domain, :host, :port]        SCOPE_OPTIONS = [:path, :shallow_path, :as, :shallow_prefix, :module, -                       :controller, :path_names, :constraints, :defaults, -                       :shallow, :blocks, :options] +                       :controller, :action, :path_names, :constraints, +                       :shallow, :blocks, :defaults, :options]        class Constraints #:nodoc:          def self.new(app, constraints, request = Rack::Request) @@ -874,6 +874,10 @@ module ActionDispatch              child            end +          def merge_action_scope(parent, child) #:nodoc: +            child +          end +            def merge_path_names_scope(parent, child) #:nodoc:              merge_options_scope(parent, child)            end @@ -1383,6 +1387,10 @@ module ActionDispatch              raise ArgumentError, "Unknown scope #{on.inspect} given to :on"            end +          if @scope[:controller] && @scope[:action] +            options[:to] ||= "#{@scope[:controller]}##{@scope[:action]}" +          end +            paths.each do |_path|              route_options = options.dup              route_options[:path] ||= _path if _path.is_a?(String)  | 
