Sha256: 01fe24eda1bb471556f161c176c03a7cddf1dc24a87e8fbb12ef35502f80f945

Contents?: true

Size: 561 Bytes

Versions: 1

Compression:

Stored size: 561 Bytes

Contents

module Iconoclast
  
  module IconHelper
    
    # Insert an image tag with an icon with name equal to "name" param and
    # extension .png, with alt attribute and options.
    # Example:
    #    <%= icon :information, "Information icon", :border => 0 %>
    # will generate:
    #    <img src="../icons/information.png" alt="Information icon" border="0" />
    def self.icon(name, alt = nil, opts = {})
      opts[:border] ||= 0
      opts[:align] ||= "bottom"
      opts[:alt] ||= alt

      image_tag "../icons/#{name}.png", opts
    end
    
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
iconoclast-0.0.1 lib/iconoclast/icon_helper.rb