aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/route_set.rb
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2010-07-06 22:20:06 +0100
committerJosé Valim <jose.valim@gmail.com>2010-07-07 00:11:13 +0200
commitb802a0d4c72fbd605b92e9f403c9b8765a6e480c (patch)
tree060f549840236cc7865d1bd85abf4e61f4ddd71a /actionpack/lib/action_dispatch/routing/route_set.rb
parentf4be0041c605daad2406ec41fa7dfa4388af5f31 (diff)
downloadrails-b802a0d4c72fbd605b92e9f403c9b8765a6e480c.tar.gz
rails-b802a0d4c72fbd605b92e9f403c9b8765a6e480c.tar.bz2
rails-b802a0d4c72fbd605b92e9f403c9b8765a6e480c.zip
When a dynamic :controller segment is present in the path add a Regexp constraint that allow matching on multiple path segments.
Using a namespace block isn't compatible with dynamic routes so we raise an ArgumentError if we detect a :module present in the scope. [#5052 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/route_set.rb')
-rw-r--r--actionpack/lib/action_dispatch/routing/route_set.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb
index 01a068a9f2..1b1a221c60 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -14,7 +14,6 @@ module ActionDispatch
def initialize(options={})
@defaults = options[:defaults]
@glob_param = options.delete(:glob)
- @module = options.delete(:module)
@controllers = {}
end
@@ -39,12 +38,11 @@ module ActionDispatch
# we should raise an error in case it's not found, because it usually means
# an user error. However, if the controller was retrieved through a dynamic
# segment, as in :controller(/:action), we should simply return nil and
- # delegate the control back to Rack cascade. Besides, if this is not a default
+ # delegate the control back to Rack cascade. Besides, if this is not a default
# controller, it means we should respect the @scope[:module] parameter.
def controller(params, default_controller=true)
if params && params.key?(:controller)
- controller_param = @module && !default_controller ?
- "#{@module}/#{params[:controller]}" : params[:controller]
+ controller_param = params[:controller]
controller_reference(controller_param)
end
rescue NameError => e