aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
authorMikel Lindsaar <raasdnil@gmail.com>2010-06-07 21:53:31 -0400
committerMikel Lindsaar <raasdnil@gmail.com>2010-06-07 21:53:31 -0400
commit21cc1ed4370666cdb1944d4591b5663fd6206ae3 (patch)
tree6aad8487b34332389d555c4db5fd1e7a6c180453 /actionpack/lib/action_view
parenta16fd961310d4df5bd20df5fe64b2f764d8aa471 (diff)
downloadrails-21cc1ed4370666cdb1944d4591b5663fd6206ae3.tar.gz
rails-21cc1ed4370666cdb1944d4591b5663fd6206ae3.tar.bz2
rails-21cc1ed4370666cdb1944d4591b5663fd6206ae3.zip
Updating image_tag to support cid:content_id "URLs"
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r--actionpack/lib/action_view/helpers/asset_tag_helper.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/asset_tag_helper.rb b/actionpack/lib/action_view/helpers/asset_tag_helper.rb
index 626cc7d3b0..25426a5547 100644
--- a/actionpack/lib/action_view/helpers/asset_tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/asset_tag_helper.rb
@@ -620,7 +620,10 @@ module ActionView
options.symbolize_keys!
src = options[:src] = path_to_image(source)
- options[:alt] = options.fetch(:alt){ File.basename(src, '.*').capitalize }
+
+ unless src =~ /^cid:/
+ options[:alt] = options.fetch(:alt){ File.basename(src, '.*').capitalize }
+ end
if size = options.delete(:size)
options[:width], options[:height] = size.split("x") if size =~ %r{^\d+x\d+$}
@@ -754,7 +757,7 @@ module ActionView
end
def is_uri?(path)
- path =~ %r{^[-a-z]+://}
+ path =~ %r{^[-a-z]+://|^cid:}
end
# Pick an asset host for this source. Returns +nil+ if no host is set,