diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2010-08-02 17:38:44 +0200 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2010-09-03 22:59:11 +0200 |
commit | 4131a2d804c54960ac70984e7453069fe8688365 (patch) | |
tree | a11611f781d5c0688feb641f5589f100538bf12b /actionpack/lib/abstract_controller | |
parent | 32baa278925c53f8885e94ea1f3d7c228d42c75f (diff) | |
download | rails-4131a2d804c54960ac70984e7453069fe8688365.tar.gz rails-4131a2d804c54960ac70984e7453069fe8688365.tar.bz2 rails-4131a2d804c54960ac70984e7453069fe8688365.zip |
Move ActionController::Railties::RoutesHelpers and ActionMailer::Railties::RoutesHelper to AbstractController::Railties::RoutesHelpers
Diffstat (limited to 'actionpack/lib/abstract_controller')
-rw-r--r-- | actionpack/lib/abstract_controller/railties/routes_helpers.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/actionpack/lib/abstract_controller/railties/routes_helpers.rb b/actionpack/lib/abstract_controller/railties/routes_helpers.rb new file mode 100644 index 0000000000..dec1e9d6d9 --- /dev/null +++ b/actionpack/lib/abstract_controller/railties/routes_helpers.rb @@ -0,0 +1,18 @@ +module AbstractController + module Railties + module RoutesHelpers + def self.with(routes) + Module.new do + define_method(:inherited) do |klass| + super(klass) + if namespace = klass.parents.detect {|m| m.respond_to?(:_railtie) } + klass.send(:include, namespace._railtie.routes.url_helpers) + else + klass.send(:include, routes.url_helpers) + end + end + end + end + end + end +end |