Class: Effective::TableRows::Boolean
- Inherits:
-
Effective::TableRow
- Object
- Effective::TableRow
- Effective::TableRows::Boolean
- Defined in:
- app/models/effective/table_rows/boolean.rb
Instance Attribute Summary
Attributes inherited from Effective::TableRow
#builder, #name, #options, #template
Instance Method Summary collapse
Methods inherited from Effective::TableRow
#controller_namespace, #hint, #initialize, #label, #label_content, #tr_class, #value
Constructor Details
This class inherits a constructor from Effective::TableRow
Instance Method Details
#content ⇒ Object
15 16 17 18 19 20 21 |
# File 'app/models/effective/table_rows/boolean.rb', line 15 def content if value template.badge('Yes', class: 'badge badge-primary mr-2') else template.badge('No', class: 'badge badge-secondary mr-2') end end |
#to_html(&block) ⇒ Object
7 8 9 10 11 12 13 |
# File 'app/models/effective/table_rows/boolean.rb', line 7 def to_html(&block) content_tag(:tr, class: tr_class) do content_tag(:td, colspan: 2) do content_tag(:span, content.presence || '-') + label_content end end end |