Class: TableCloth::Presenters::Default
- Inherits:
-
TableCloth::Presenter
- Object
- TableCloth::Presenter
- TableCloth::Presenters::Default
- Defined in:
- lib/table_cloth/presenters/default.rb
Instance Attribute Summary
Attributes inherited from TableCloth::Presenter
#objects, #table, #view_context
Instance Method Summary collapse
Methods inherited from TableCloth::Presenter
#columns, #initialize, #row_values, #rows
Constructor Details
This class inherits a constructor from TableCloth::Presenter
Instance Method Details
#render_table ⇒ Object
4 5 6 7 8 9 |
# File 'lib/table_cloth/presenters/default.rb', line 4 def render_table @render_table ||= ElementFactory::Element.new(:table, (:table)).tap do |table| table << thead table << tbody end.to_html end |
#tbody ⇒ Object
17 18 19 20 21 |
# File 'lib/table_cloth/presenters/default.rb', line 17 def tbody @tbody ||= ElementFactory::Element.new(:tbody, (:tbody)).tap do |tbody| objects.each {|object| tbody << row_for_object(object) } end end |
#thead ⇒ Object
11 12 13 14 15 |
# File 'lib/table_cloth/presenters/default.rb', line 11 def thead @thead ||= ElementFactory::Element.new(:thead, (:thead)).tap do |thead| thead << thead_row end end |