Class: SimpleTable::Body
Instance Attribute Summary
Attributes inherited from Rows
Attributes inherited from Tag
Instance Method Summary collapse
Methods inherited from Rows
Methods inherited from Tag
#add_class, #collection_class, #collection_name, #head?, #initialize, #table
Constructor Details
This class inherits a constructor from SimpleTable::Rows
Instance Method Details
#render ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/simple_table/body.rb', line 5 def render build super(''.tap do |html| table.collection.each_with_index do |record, ix| html << rows.map do |row| # FIXME: For some reason the options hash is accumulated from one row to the next. # Furthermore the rows instance variable only contains one row (should contain 3 when running render_test.rb) # This causes setting of the alternate class in render_test.rb to fail. # As a temporary fix we are resetting options here. row.instance_variable_set(:'@options', {}) row.render(record, (record, ix, )) end.join end end) end |