module CGI::HtmlExtension
def image_button(src = "", name = nil, alt = nil)
image_button("SRC" => "url", "ALT" => "string")
#
image_button("url", "name", "string")
#
image_button("url")
Alternatively, the attributes can be specified as a hash.
is the input name. +alt+ is the alternative text for the image.
+src+ is the URL of the image to use for the button. +name+
Generate an Image Button Input element as a string.
def image_button(src = "", name = nil, alt = nil) attributes = if src.kind_of?(String) { "TYPE" => "image", "SRC" => src, "NAME" => name, "ALT" => alt } else src["TYPE"] = "image" src["SRC"] ||= "" src end input(attributes) end