Image Tag Silent Alt plugin

Plugin details

In a call to image_tag Rails will set the 'alt' tag to the filename which isn't what you usually want. This plugin sets an empty alt tag unless it's already been set.

Repositorysvn://svn.pjkh.com/rails/plugins/image_tag_silent_alt Author Philip Hallstrom Tags tag, image LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install svn://svn.pjkh.com/rails/plugins/image_tag_silent_alt
image_tag("xml.png") # => < img alt="" src="/images/xml.png" />
image_tag("rss.png", :alt => "rss syndication") # => < img alt="rss syndication" src="/images/rss.png" />
image_tag("rss.png", :alt => "") # => < img alt="" src="/images/rss.png" />
image_tag("gold.png", :size => "45x70") # => < img alt="" height="70" src="/images/gold.png" width="45" />
image_tag("symbolize.png", "size" => "45x70") # => < img alt="" height="70" src="/images/symbolize.png" width="45" />
image_tag("http://www.rubyonrails.com/images/rails.png") # => < img alt="" src="http://www.rubyonrails.com/images/rails.png" />

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | Back in time (1 older version) | Last edited by: hardway, 5 months ago