module CGI::HtmlExtension
def img(src = "", alt = "", width = nil, height = nil)
img("SRC" => "src", "ALT" => "alt", "WIDTH" => 100, "HEIGHT" => 50)
#
img("src", "alt", 100, 50)
Alternatively, the attributes can be specified as a hash.
its height.
the image. +width+ is the width of the image, and +height+ is
+src+ is the URL of the image. +alt+ is the alternative text for
Generate an Image element as a string.
def img(src = "", alt = "", width = nil, height = nil) attributes = if src.kind_of?(String) { "SRC" => src, "ALT" => alt } else src end attributes["WIDTH"] = width.to_s if width attributes["HEIGHT"] = height.to_s if height super(attributes) end