Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
need to make sure the asset type is cached with it in Cache.. name is…
… sufficient, not self

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information
Aaron Batalion authored and jeremy committed Nov 19, 2008
1 parent d7f4921 commit e54c33b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions actionpack/lib/action_view/helpers/asset_tag_helper.rb
Expand Up @@ -538,12 +538,12 @@ def initialize(template, controller, source, include_host = true)
@source = source
@include_host = include_host
@cache_key = if controller.respond_to?(:request)
[controller.request.protocol,
[self.class.name,controller.request.protocol,
ActionController::Base.asset_host,
ActionController::Base.relative_url_root,
source, include_host]
else
[ActionController::Base.asset_host, source, include_host]
[self.class.name,ActionController::Base.asset_host, source, include_host]
end
end

Expand Down
6 changes: 6 additions & 0 deletions actionpack/test/template/asset_tag_helper_test.rb
Expand Up @@ -648,4 +648,10 @@ def test_asset_host_without_protocol_should_use_request_protocol_even_if_path_pr
ensure
ActionController::Base.asset_host = nil
end

def test_assert_css_and_js_of_the_same_name_return_correct_extension
assert_dom_equal(%(/collaboration/hieraki/javascripts/foo.js), javascript_path("foo"))
assert_dom_equal(%(/collaboration/hieraki/stylesheets/foo.css), stylesheet_path("foo"))

end
end

0 comments on commit e54c33b

Please sign in to comment.