diff options
Diffstat (limited to 'actionpack/lib/abstract_controller/railties')
-rw-r--r-- | actionpack/lib/abstract_controller/railties/routes_helpers.rb | 7 |
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..b6e5631a4e 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.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 |