diff options
author | Joshua Peek <josh@joshpeek.com> | 2011-03-22 15:43:40 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2011-03-22 15:43:40 -0500 |
commit | 628c31b353706877322e7613702d1bd4a59e3514 (patch) | |
tree | 79f24835f1202b93943b0fcce42fbe9ff4251816 /actionpack/lib/action_view/helpers | |
parent | 6aff1d0f6f0bcd82d2f99a757b9ae58caa3290c5 (diff) | |
download | rails-628c31b353706877322e7613702d1bd4a59e3514.tar.gz rails-628c31b353706877322e7613702d1bd4a59e3514.tar.bz2 rails-628c31b353706877322e7613702d1bd4a59e3514.zip |
Add sprockets md5s to asset tags
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r-- | actionpack/lib/action_view/helpers/asset_tag_helpers/javascript_tag_helpers.rb | 10 | ||||
-rw-r--r-- | actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/asset_tag_helpers/javascript_tag_helpers.rb b/actionpack/lib/action_view/helpers/asset_tag_helpers/javascript_tag_helpers.rb index 82bbfcc7d2..2187887b49 100644 --- a/actionpack/lib/action_view/helpers/asset_tag_helpers/javascript_tag_helpers.rb +++ b/actionpack/lib/action_view/helpers/asset_tag_helpers/javascript_tag_helpers.rb @@ -173,6 +173,16 @@ module ActionView # # javascript_include_tag :all, :cache => true, :recursive => true def javascript_include_tag(*sources) + if config.perform_caching + sources = sources.map do |source| + if source =~ /^\/assets\/(.+)/ + "/assets/#{Rails.application.assets.url($1)}" + else + source + end + end + end + @javascript_include ||= JavascriptIncludeTag.new(config, asset_paths) @javascript_include.include_tag(*sources) end diff --git a/actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb b/actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb index a48c87b49a..b9f49f37b4 100644 --- a/actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb +++ b/actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb @@ -136,6 +136,16 @@ module ActionView # stylesheet_link_tag :all, :concat => true # def stylesheet_link_tag(*sources) + if config.perform_caching + sources = sources.map do |source| + if source =~ /^\/assets\/(.+)/ + "/assets/#{Rails.application.assets.url($1)}" + else + source + end + end + end + @stylesheet_include ||= StylesheetIncludeTag.new(config, asset_paths) @stylesheet_include.include_tag(*sources) end |