Class: Forms::CollectionCheckBox
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- Forms::CollectionCheckBox
- Defined in:
- lib/forms/collection_check_box.rb
Overview
A single checkbox within a collection_check_boxes group.
Instance Method Summary collapse
-
#initialize(name:, id:, value:, checked:, **options) ⇒ CollectionCheckBox
constructor
A new instance of CollectionCheckBox.
- #view_template ⇒ Object
Constructor Details
#initialize(name:, id:, value:, checked:, **options) ⇒ CollectionCheckBox
Returns a new instance of CollectionCheckBox.
6 7 8 9 10 11 12 13 |
# File 'lib/forms/collection_check_box.rb', line 6 def initialize(name:, id:, value:, checked:, **) @name = name @id = id @value = value @checked = checked @options = super() end |
Instance Method Details
#view_template ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/forms/collection_check_box.rb', line 15 def view_template input( type: "checkbox", name: @name, id: @id, value: @value, class: @options[:class] || "checkbox", checked: @checked || nil ) end |