End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
CGI::HtmlExtension#textarea
textarea(name = "", cols = 70, rows = 10) { || ... }
lib/cgi/html.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/lib/cgi/html.rb, line 808
def textarea(name = "", cols = 70, rows = 10) # :yield:
attributes = if name.kind_of?(String)
{ "NAME" => name, "COLS" => cols.to_s,
"ROWS" => rows.to_s }
else
name
end
super(attributes)
end
Generate a TextArea element, as a String.
name is the name of the textarea. cols is the number of columns and rows is the number of rows in the display.
Alternatively, the attributes can be specified as a hash.
The body is provided by the passed-in no-argument block
Example
textarea("name") # = textarea("NAME" => "name", "COLS" => 70, "ROWS" => 10) textarea("name", 40, 5) # = textarea("NAME" => "name", "COLS" => 40, "ROWS" => 5)