From ae04fbfee961a7e6b90a3373dc305f100e50614f Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Tue, 13 Sep 2011 02:45:05 -0700 Subject: Fix asset_path relative_url_root method --- actionpack/lib/action_view/asset_paths.rb | 8 +++++--- actionpack/lib/sprockets/helpers/rails_helper.rb | 4 ---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/actionpack/lib/action_view/asset_paths.rb b/actionpack/lib/action_view/asset_paths.rb index 9c1c821f8f..75164b8134 100644 --- a/actionpack/lib/action_view/asset_paths.rb +++ b/actionpack/lib/action_view/asset_paths.rb @@ -119,9 +119,11 @@ module ActionView end def relative_url_root - config = controller.config if controller.respond_to?(:config) - config ||= config.action_controller if config.action_controller.present? - config.relative_url_root + if config.action_controller.present? + config.action_controller.relative_url_root + else + config.relative_url_root + end end def asset_host_config diff --git a/actionpack/lib/sprockets/helpers/rails_helper.rb b/actionpack/lib/sprockets/helpers/rails_helper.rb index 5785da5124..998f0bceb7 100644 --- a/actionpack/lib/sprockets/helpers/rails_helper.rb +++ b/actionpack/lib/sprockets/helpers/rails_helper.rb @@ -149,10 +149,6 @@ module Sprockets source end end - - def relative_url_root - has_request? ? super : config.action_controller.relative_url_root - end end end end -- cgit v1.2.3