Class: TableFor::RowBuilder
- Inherits:
-
Struct
- Object
- Struct
- TableFor::RowBuilder
- Defined in:
- lib/table_for/row_builder.rb
Instance Attribute Summary collapse
-
#record ⇒ Object
Returns the value of attribute record.
-
#table ⇒ Object
Returns the value of attribute table.
Instance Method Summary collapse
Instance Attribute Details
#record ⇒ Object
Returns the value of attribute record
2 3 4 |
# File 'lib/table_for/row_builder.rb', line 2 def record @record end |
#table ⇒ Object
Returns the value of attribute table
2 3 4 |
# File 'lib/table_for/row_builder.rb', line 2 def table @table end |
Instance Method Details
#cell(value) ⇒ Object
10 11 12 13 14 |
# File 'lib/table_for/row_builder.rb', line 10 def cell(value) content_tag(:td) do if value.is_a?(Symbol) then record.send(value).to_s else value.to_s end end end |
#cells(*values) ⇒ Object
6 7 8 |
# File 'lib/table_for/row_builder.rb', line 6 def cells(*values) values.map { |v| cell(v) }.join.html_safe end |