Class: Caisson::Helpers::Form::Field::Checkbox
- Defined in:
- lib/caisson/helpers/form/field/checkbox.rb
Instance Method Summary collapse
-
#build(name, selected, options = {}) ⇒ Object
************************************************************************************* PUBLIC INSTANCE METHODS *************************************************************************************.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Caisson::Helpers::Form::Field::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Caisson::Helpers::Form::Field::Base
Instance Method Details
#build(name, selected, options = {}) ⇒ Object
************************************************************************************* PUBLIC INSTANCE METHODS *************************************************************************************
9 10 11 12 13 14 15 16 |
# File 'lib/caisson/helpers/form/field/checkbox.rb', line 9 def build(name, selected, ={}) content = [] content << hidden_field_tag(name, '0', id: nil) content << check_box_tag(name, '1', parse_selected(selected), generate_attributes(name, )) content << .delete(:label) return content_tag(:label, content.join("\n").html_safe, :for => name.parameterize.underscore) end |