aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/abstract_controller/railties/routes_helpers.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/abstract_controller/railties/routes_helpers.rb')
-rw-r--r--actionpack/lib/abstract_controller/railties/routes_helpers.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/actionpack/lib/abstract_controller/railties/routes_helpers.rb b/actionpack/lib/abstract_controller/railties/routes_helpers.rb
index c97be074c8..fbd93705ed 100644
--- a/actionpack/lib/abstract_controller/railties/routes_helpers.rb
+++ b/actionpack/lib/abstract_controller/railties/routes_helpers.rb
@@ -7,8 +7,11 @@ module AbstractController
Module.new do
define_method(:inherited) do |klass|
super(klass)
-
- routes.include_helpers klass, include_path_helpers
+ if namespace = klass.module_parents.detect { |m| m.respond_to?(:railtie_routes_url_helpers) }
+ klass.include(namespace.railtie_routes_url_helpers(include_path_helpers))
+ else
+ klass.include(routes.url_helpers(include_path_helpers))
+ end
end
end
end