Add documentation to AssetTagHelper#image_alt [ci skip]

This commit is contained in:
Florent Guilleux 2012-12-01 14:43:39 -05:00
parent 9bc16d0da2
commit fb39249f36

@ -210,6 +210,9 @@ def image_tag(source, options={})
tag("img", options)
end
# Returns a string suitable for an html image tag alt attribute.
# +src+ is meant to be an image file path.
# It removes the basename of the file path and the digest, if any.
def image_alt(src)
File.basename(src, '.*').sub(/-[[:xdigit:]]{32}\z/, '').capitalize
end