Add documentation to AssetTagHelper#image_alt [ci skip]
This commit is contained in:
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
|
||||
|
Loading…
Reference in New Issue
Block a user