Skip to content
This repository
Browse code

Add documentation to AssetTagHelper#image_alt [ci skip]

  • Loading branch information...
commit fb39249f368bca4563e31939a3439277201b641f 1 parent 9bc16d0
Florent Guilleux authored December 01, 2012
3  actionpack/lib/action_view/helpers/asset_tag_helper.rb
@@ -210,6 +210,9 @@ def image_tag(source, options={})
210 210
         tag("img", options)
211 211
       end
212 212
 
  213
+      # Returns a string suitable for an html image tag alt attribute.
  214
+      # +src+ is meant to be an image file path.
  215
+      # It removes the basename of the file path and the digest, if any.
213 216
       def image_alt(src)
214 217
         File.basename(src, '.*').sub(/-[[:xdigit:]]{32}\z/, '').capitalize
215 218
       end

0 notes on commit fb39249

Please sign in to comment.
Something went wrong with that request. Please try again.