Skip to content
This repository
Browse code

Fix asset_path relative_url_root method

  • Loading branch information...
commit ae04fbfee961a7e6b90a3373dc305f100e50614f 1 parent 60fd88d
Santiago Pastorino spastorino authored
8 actionpack/lib/action_view/asset_paths.rb
@@ -119,9 +119,11 @@ def compute_asset_host(source)
119 119 end
120 120
121 121 def relative_url_root
122   - config = controller.config if controller.respond_to?(:config)
123   - config ||= config.action_controller if config.action_controller.present?
124   - config.relative_url_root
  122 + if config.action_controller.present?
  123 + config.action_controller.relative_url_root
  124 + else
  125 + config.relative_url_root
  126 + end
125 127 end
126 128
127 129 def asset_host_config
4 actionpack/lib/sprockets/helpers/rails_helper.rb
@@ -149,10 +149,6 @@ def rewrite_extension(source, dir, ext)
149 149 source
150 150 end
151 151 end
152   -
153   - def relative_url_root
154   - has_request? ? super : config.action_controller.relative_url_root
155   - end
156 152 end
157 153 end
158 154 end

0 comments on commit ae04fbf

Please sign in to comment.
Something went wrong with that request. Please try again.