Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
CGI::HtmlExtension#reset
reset(value = nil, name = nil)
lib/cgi/html.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.4.1/lib/cgi/html.rb, line 720
def reset(value = nil, name = nil)
attributes = if (not value) or value.kind_of?(String)
{ "TYPE" => "reset", "VALUE" => value, "NAME" => name }
else
value["TYPE"] = "reset"
value
end
input(attributes)
end
Generate a reset button Input element, as a String.
This resets the values on a form to their initial values. value is the text displayed on the button. name is the name of this button.
Alternatively, the attributes can be specified as a hash.
Example
reset # <INPUT TYPE="reset"> reset("reset") # <INPUT TYPE="reset" VALUE="reset"> reset("VALUE" => "reset", "ID" => "foo") # <INPUT TYPE="reset" VALUE="reset" ID="foo">