Permalink
Browse files

Move ActionController::Railties::RoutesHelpers and ActionMailer::Rail…

…ties::RoutesHelper to AbstractController::Railties::RoutesHelpers
  • Loading branch information...
1 parent 32baa27 commit 4131a2d804c54960ac70984e7453069fe8688365 @drogus drogus committed Aug 2, 2010
@@ -1,6 +1,6 @@
require "action_mailer"
require "rails"
-require "action_mailer/railties/routes_helpers"
+require "abstract_controller/railties/routes_helpers"
module ActionMailer
class Railtie < Rails::Railtie
@@ -19,7 +19,7 @@ class Railtie < Rails::Railtie
options.stylesheets_dir ||= paths.public.stylesheets.to_a.first
ActiveSupport.on_load(:action_mailer) do
- extend ::ActionMailer::Railties::RoutesHelpers.with(app.routes)
+ extend ::AbstractController::Railties::RoutesHelpers.with(app.routes)
include app.routes.mounted_helpers(:app)
options.each { |k,v| send("#{k}=", v) }
end
@@ -1,4 +1,4 @@
-module ActionMailer
+module AbstractController
module Railties
module RoutesHelpers
def self.with(routes)
@@ -4,7 +4,7 @@
require "action_view/railtie"
require "active_support/deprecation/proxy_wrappers"
require "active_support/deprecation"
-require "action_controller/railties/routes_helpers"
+require "abstract_controller/railties/routes_helpers"
module ActionController
class Railtie < Rails::Railtie
@@ -51,7 +51,7 @@ class Railtie < Rails::Railtie
options.helpers_path ||= paths.app.helpers.to_a
ActiveSupport.on_load(:action_controller) do
- extend ::ActionController::Railties::RoutesHelpers.with(app.routes)
+ extend ::AbstractController::Railties::RoutesHelpers.with(app.routes)
include app.routes.mounted_helpers(:app)
options.each { |k,v| send("#{k}=", v) }
end
@@ -1,17 +0,0 @@
-module ActionController
- 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) }
- routes = namespace._railtie.routes
- end
- klass.send(:include, routes.url_helpers)
- end
- end
- end
- end
- end
-end

0 comments on commit 4131a2d

Please sign in to comment.