1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Do not require passing :app to mounted helpers, it's actually useless and not DRY

This commit is contained in:
Piotr Sarnacki 2010-09-06 20:47:25 +02:00
parent a5d894ce56
commit 18aee33335
4 changed files with 4 additions and 4 deletions

View file

@ -21,7 +21,7 @@ module ActionMailer
ActiveSupport.on_load(:action_mailer) do
include AbstractController::UrlFor
extend ::AbstractController::Railties::RoutesHelpers.with(app.routes)
include app.routes.mounted_helpers(:app)
include app.routes.mounted_helpers
options.each { |k,v| send("#{k}=", v) }
end
end

View file

@ -27,7 +27,7 @@ module ActionController
options.page_cache_directory ||= paths.public.to_a.first
ActiveSupport.on_load(:action_controller) do
include app.routes.mounted_helpers(:app)
include app.routes.mounted_helpers
extend ::AbstractController::Railties::RoutesHelpers.with(app.routes)
extend ::ActionController::Railties::Paths.with(app)
options.each { |k,v| send("#{k}=", v) }

View file

@ -262,7 +262,7 @@ module ActionDispatch
module MountedHelpers
end
def mounted_helpers(name = nil)
def mounted_helpers(name = :app)
define_mounted_helper(name) if name
MountedHelpers
end

View file

@ -72,7 +72,7 @@ module TestGenerationPrefix
class ::InsideEngineGeneratingController < ActionController::Base
include BlogEngine.routes.url_helpers
include RailsApplication.routes.mounted_helpers(:app)
include RailsApplication.routes.mounted_helpers
def index
render :text => posts_path