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="value" CHECKED>

radio_button("NAME" => "name", "VALUE" => "value", "ID" => "foo")
  # <INPUT TYPE="radio" NAME="name" VALUE="value" ID="foo">
doc_ruby_on_rails
2015-03-31 22:07:16
Comments
Leave a Comment

Please login to continue.