Skip to content
This repository
Browse code

Fixed that AssetTagHelper#compute_public_path shouldn't cache the ass…

…et_host along with the source or per-request proc's won't run [DHH]
  • Loading branch information...
commit 8fe01de2e8753d045408ecde3178ab4e9192bf9a 1 parent 8f640c3
David Heinemeier Hansson dhh authored
2  actionpack/CHANGELOG
... ... @@ -1,5 +1,7 @@
1 1 *Edge*
2 2
  3 +* Fixed that AssetTagHelper#compute_public_path shouldn't cache the asset_host along with the source or per-request proc's won't run [DHH]
  4 +
3 5 * Add :as option to render a collection of partials with a custom local variable name. #509 [Simon Jefford, Pratik Naik]
4 6
5 7 render :partial => 'other_people', :collection => @people, :as => :person
25 actionpack/lib/action_view/helpers/asset_tag_helper.rb
@@ -485,21 +485,24 @@ def compute_public_path(source, dir, ext = nil, include_host = true)
485 485 source = "#{@controller.request.relative_url_root}#{source}"
486 486 end
487 487 end
488   - source = rewrite_asset_path(source)
489 488
490   - if include_host
491   - host = compute_asset_host(source)
  489 + rewrite_asset_path(source)
  490 + end
  491 + end
492 492
493   - if has_request && !host.blank? && host !~ %r{^[-a-z]+://}
494   - host = "#{@controller.request.protocol}#{host}"
495   - end
  493 + source = ActionView::Base.computed_public_paths[cache_key]
496 494
497   - "#{host}#{source}"
498   - else
499   - source
500   - end
501   - end
  495 + if include_host && source !~ %r{^[-a-z]+://}
  496 + host = compute_asset_host(source)
  497 +
  498 + if has_request && !host.blank? && host !~ %r{^[-a-z]+://}
  499 + host = "#{@controller.request.protocol}#{host}"
502 500 end
  501 +
  502 + "#{host}#{source}"
  503 + else
  504 + source
  505 + end
503 506 end
504 507
505 508 # Pick an asset host for this source. Returns +nil+ if no host is set,

0 comments on commit 8fe01de

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