aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/mapper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/mapper.rb')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb8
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 708f0a2b43..961c3afd91 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -60,11 +60,11 @@ module ActionDispatch
end
class Mapping #:nodoc:
- IGNORE_OPTIONS = [:as, :via, :on, :constraints, :defaults, :only, :except, :anchor, :shallow, :shallow_path, :shallow_prefix]
+ IGNORE_OPTIONS = [:via, :on, :constraints, :defaults, :only, :except, :shallow, :shallow_path, :shallow_prefix]
ANCHOR_CHARACTERS_REGEX = %r{\A(\\A|\^)|(\\Z|\\z|\$)\Z}
attr_reader :scope, :options, :requirements, :conditions, :defaults
- attr_reader :to, :default_controller, :default_action
+ attr_reader :to, :default_controller, :default_action, :as, :anchor
def initialize(scope, path, options)
@scope = scope
@@ -74,6 +74,8 @@ module ActionDispatch
@to = options.delete :to
@default_controller = options[:controller] || scope[:controller]
@default_action = options[:action] || scope[:action]
+ @as = options.delete :as
+ @anchor = options.delete :anchor
formatted = options.delete :format
@@ -87,7 +89,7 @@ module ActionDispatch
end
def to_route
- [ app, conditions, requirements, defaults, options[:as], options[:anchor] ]
+ [ app, conditions, requirements, defaults, as, anchor ]
end
private