aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorXavier Shay <xavier@rhnh.net>2013-07-07 14:23:36 -0700
committerXavier Shay <xavier@rhnh.net>2015-08-07 19:50:14 -0700
commitf26ae7d10f9b890a9ac5de70f0be4a9cf9149233 (patch)
tree623cf29eb735e8184f1775193bbf513c94088724 /actionpack
parent05934d24aff62d66fc62621aa38dae6456e276be (diff)
downloadrails-f26ae7d10f9b890a9ac5de70f0be4a9cf9149233.tar.gz
rails-f26ae7d10f9b890a9ac5de70f0be4a9cf9149233.tar.bz2
rails-f26ae7d10f9b890a9ac5de70f0be4a9cf9149233.zip
Move `controller_reference` and `controller_class_names` to protected
scope so that they are available to subclasses.
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/routing/route_set.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb
index c9775a40b7..e885bfa770 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -62,13 +62,17 @@ module ActionDispatch
raise ActionController::RoutingError, e.message, e.backtrace if default_controller
end
- private
+ protected
+
+ attr_reader :controller_class_names
def controller_reference(controller_param)
- const_name = @controller_class_names[controller_param] ||= "#{controller_param.camelize}Controller"
+ const_name = controller_class_names[controller_param] ||= "#{controller_param.camelize}Controller"
ActiveSupport::Dependencies.constantize(const_name)
end
+ private
+
def dispatch(controller, action, req)
controller.action(action).call(req.env)
end