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"], ["bar", true], "baz")
  # <INPUT TYPE="radio" NAME="name" VALUE="foo">foo
  # <INPUT TYPE="radio" CHECKED NAME="name" VALUE="bar">bar
  # <INPUT TYPE="radio" NAME="name" VALUE="baz">baz

radio_group("name", ["1", "Foo"], ["2", "Bar", true], "Baz")
  # <INPUT TYPE="radio" NAME="name" VALUE="1">Foo
  # <INPUT TYPE="radio" CHECKED NAME="name" VALUE="2">Bar
  # <INPUT TYPE="radio" NAME="name" VALUE="Baz">Baz

radio_group("NAME" => "name",
              "VALUES" => ["foo", "bar", "baz"])

radio_group("NAME" => "name",
              "VALUES" => [["foo"], ["bar", true], "baz"])

radio_group("NAME" => "name",
              "VALUES" => [["1", "Foo"], ["2", "Bar", true], "Baz"])
doc_ruby_on_rails
2015-03-31 22:10:09
Comments
Leave a Comment

Please login to continue.