aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/asset_paths.rb
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2011-09-14 14:47:49 -0700
committerSantiago Pastorino <santiago@wyeworks.com>2011-09-14 15:02:17 -0700
commitda7f0426ec7b0aa053489633c2a8a3da6423654f (patch)
tree0505b073b0cfd20fdc284fd2e641e1e42deeec53 /actionpack/lib/action_view/asset_paths.rb
parent49476eee781b8a8b936b425b20ee40d036053128 (diff)
downloadrails-da7f0426ec7b0aa053489633c2a8a3da6423654f.tar.gz
rails-da7f0426ec7b0aa053489633c2a8a3da6423654f.tar.bz2
rails-da7f0426ec7b0aa053489633c2a8a3da6423654f.zip
Allow asset tag helper methods to accept :digest => false option in order to completely avoid the digest generation.
Diffstat (limited to 'actionpack/lib/action_view/asset_paths.rb')
-rw-r--r--actionpack/lib/action_view/asset_paths.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/asset_paths.rb b/actionpack/lib/action_view/asset_paths.rb
index 75164b8134..cf30ad7e57 100644
--- a/actionpack/lib/action_view/asset_paths.rb
+++ b/actionpack/lib/action_view/asset_paths.rb
@@ -21,14 +21,15 @@ module ActionView
# When :relative (default), the protocol will be determined by the client using current protocol
# When :request, the protocol will be the request protocol
# Otherwise, the protocol is used (E.g. :http, :https, etc)
- def compute_public_path(source, dir, ext = nil, include_host = true, protocol = nil)
+ def compute_public_path(source, dir, options = {})
source = source.to_s
return source if is_uri?(source)
- source = rewrite_extension(source, dir, ext) if ext
- source = rewrite_asset_path(source, dir)
+ options[:include_host] ||= true
+ source = rewrite_extension(source, dir, options[:ext]) if options[:ext]
+ source = rewrite_asset_path(source, dir, options)
source = rewrite_relative_url_root(source, relative_url_root)
- source = rewrite_host_and_protocol(source, protocol) if include_host
+ source = rewrite_host_and_protocol(source, options[:protocol]) if options[:include_host]
source
end