aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/route_set.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-12-01 22:48:42 -0600
committerJoshua Peek <josh@joshpeek.com>2009-12-01 22:48:42 -0600
commit2fbd6f46fd00a334119f1a25394046963831ce3e (patch)
tree1328ee8ade328a129df47ddae815bd5a0c6dab5b /actionpack/lib/action_dispatch/routing/route_set.rb
parent7fe19d415ab80727d685c163d7a0413ca6bfe585 (diff)
downloadrails-2fbd6f46fd00a334119f1a25394046963831ce3e.tar.gz
rails-2fbd6f46fd00a334119f1a25394046963831ce3e.tar.bz2
rails-2fbd6f46fd00a334119f1a25394046963831ce3e.zip
Simply track controller namespaces instead of a complete list of
possible controllers to route to
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/route_set.rb')
-rw-r--r--actionpack/lib/action_dispatch/routing/route_set.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb
index 18e18c5820..c2f6531a74 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -27,11 +27,13 @@ module ActionDispatch
end
end
+ unless controller = controller(params)
+ return [417, {}, []]
+ end
+
if env['action_controller.recognize']
- controller(params)
[200, {}, params]
else
- controller = controller(params)
controller.action(params[:action]).call(env)
end
end
@@ -42,8 +44,8 @@ module ActionDispatch
controller = "#{params[:controller].camelize}Controller"
ActiveSupport::Inflector.constantize(controller)
end
- rescue NameError => e
- raise ActionController::RoutingError, e.message
+ rescue NameError
+ nil
end
def merge_default_action!(params)