diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-12-01 22:22:48 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-12-01 22:22:48 -0600 |
commit | 7fe19d415ab80727d685c163d7a0413ca6bfe585 (patch) | |
tree | 87322250e62b727bc8df7001b2c6c5459a8bc183 /actionpack/lib/action_dispatch/routing | |
parent | 30ae3538a3e281be3d6e8ca337a0790c71f8a9b2 (diff) | |
download | rails-7fe19d415ab80727d685c163d7a0413ca6bfe585.tar.gz rails-7fe19d415ab80727d685c163d7a0413ca6bfe585.tar.bz2 rails-7fe19d415ab80727d685c163d7a0413ca6bfe585.zip |
Make recognize try to constantize controller to see if it exists
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/route_set.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index 79e15edeaa..18e18c5820 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -28,6 +28,7 @@ module ActionDispatch end if env['action_controller.recognize'] + controller(params) [200, {}, params] else controller = controller(params) @@ -41,6 +42,8 @@ module ActionDispatch controller = "#{params[:controller].camelize}Controller" ActiveSupport::Inflector.constantize(controller) end + rescue NameError => e + raise ActionController::RoutingError, e.message end def merge_default_action!(params) |