popup_menu

popup_menu(name = "", *values) Instance Public methods Generate a Select element as a string. name is the name of the element. The values are the options that can be selected from the Select menu. Each value can be a String or a one, two, or three-element Array. If a String or a one-element Array, this is both the value of that option and the text displayed for it. If a three-element Array, the elements are the option value, displayed text, and a boolean value specifying whether

radio_button

radio_button(name = "", value = nil, checked = nil) Instance Public methods Generates a radio-button Input element. name is the name of the input field. value is the value of the field if checked. checked specifies whether the field starts off checked. Alternatively, the attributes can be specified as a hash. radio_button("name", "value") # <INPUT TYPE="radio" NAME="name" VALUE="value"> radio_button("name", "value", true) # <INPUT TYPE="radio" NAME="name" VALUE="val

radio_group

radio_group(name = "", *values) Instance Public methods Generate a sequence of radio button Input elements, as a String. This works the same as checkbox_group(). However, it is not valid to have more than one radiobutton in a group checked. radio_group("name", "foo", "bar", "baz") # <INPUT TYPE="radio" NAME="name" VALUE="foo">foo # <INPUT TYPE="radio" NAME="name" VALUE="bar">bar # <INPUT TYPE="radio" NAME="name" VALUE="baz">baz radio_group("name", ["foo"],

reset

reset(value = nil, name = nil) Instance Public methods 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. reset # <INPUT TYPE="reset"> reset("reset") # <INPUT TYPE="reset" VALUE="reset"> reset("VALUE" => "reset", "ID" => "foo") # <INPUT TYPE="reset" VALUE="reset"

scrolling_list

scrolling_list(name = "", *values) Instance Public methods Alias for: popup_menu

submit

submit(value = nil, name = nil) Instance Public methods Generate a submit button Input element, as a String. value is the text to display on the button. name is the name of the input. Alternatively, the attributes can be specified as a hash. submit # <INPUT TYPE="submit"> submit("ok") # <INPUT TYPE="submit" VALUE="ok"> submit("ok", "button1") # <INPUT TYPE="submit" VALUE="ok" NAME="button1"> submit("VALUE" => "ok", "NAME" => "button1", "ID" => "

text_field

text_field(name = "", value = nil, size = 40, maxlength = nil) Instance Public methods Generate a text field Input element, as a String. name is the name of the input field. value is its initial value. size is the size of the input area. maxlength is the maximum length of input accepted. Alternatively, the attributes can be specified as a hash. text_field("name") # <INPUT TYPE="text" NAME="name" SIZE="40"> text_field("name", "value") # <INPUT TYPE="text" NAME="name

textarea

textarea(name = "", cols = 70, rows = 10) Instance Public methods 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 textarea("name") # = textarea("NAME" => "name", "COLS" => 70, "ROWS" => 10) textarea("name", 40, 5) # = textarea("NAME" => "name", "C

[]

[](key) Instance Public methods Get the value for the parameter with a given key. If the parameter has multiple values, only the first will be retrieved; use params to get the array of values.

has_key?

has_key?(*args) Instance Public methods Returns true if a given query string parameter exists. key? include?