checkbox

checkbox(name = "", value = nil, checked = nil)
Instance Public methods

Generate a Checkbox Input element as a string.

The attributes of the element can be specified as three arguments, name, value, and checked. checked is a boolean value; if true, the CHECKED attribute will be included in the element.

Alternatively, the attributes can be specified as a hash.

1
2
3
4
5
6
7
8
checkbox("name")
  # = checkbox("NAME" => "name")
 
checkbox("name", "value")
  # = checkbox("NAME" => "name", "VALUE" => "value")
 
checkbox("name", "value", true)
  # = checkbox("NAME" => "name", "VALUE" => "value", "CHECKED" => true)
doc_ruby_on_rails
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.