Method: Padrino::Helpers::AssetTagHelpers#image_alt
- Defined in:
- padrino-helpers/lib/padrino-helpers/asset_tag_helpers.rb
permalink #image_alt(src) ⇒ String
Returns a string suitable for an alt attribute of img element.
223 224 225 |
# File 'padrino-helpers/lib/padrino-helpers/asset_tag_helpers.rb', line 223 def image_alt(src) File.basename(src, '.*').sub(/-[[:xdigit:]]{32,64}\z/, '').tr('-_', ' ').capitalize end |