Class: TableFor::Table
- Inherits:
-
Struct
- Object
- Struct
- TableFor::Table
- Defined in:
- lib/table_for/table.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#columns ⇒ Object
Returns the value of attribute columns.
-
#html ⇒ Object
Returns the value of attribute html.
-
#model_class ⇒ Object
Returns the value of attribute model_class.
-
#records ⇒ Object
Returns the value of attribute records.
-
#rows ⇒ Object
Returns the value of attribute rows.
-
#template ⇒ Object
Returns the value of attribute template.
Instance Method Summary collapse
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block
2 3 4 |
# File 'lib/table_for/table.rb', line 2 def block @block end |
#columns ⇒ Object
Returns the value of attribute columns.
3 4 5 |
# File 'lib/table_for/table.rb', line 3 def columns @columns end |
#html ⇒ Object
Returns the value of attribute html
2 3 4 |
# File 'lib/table_for/table.rb', line 2 def html @html end |
#model_class ⇒ Object
Returns the value of attribute model_class
2 3 4 |
# File 'lib/table_for/table.rb', line 2 def model_class @model_class end |
#records ⇒ Object
Returns the value of attribute records
2 3 4 |
# File 'lib/table_for/table.rb', line 2 def records @records end |
#rows ⇒ Object
Returns the value of attribute rows.
3 4 5 |
# File 'lib/table_for/table.rb', line 3 def rows @rows end |
#template ⇒ Object
Returns the value of attribute template
2 3 4 |
# File 'lib/table_for/table.rb', line 2 def template @template end |
Instance Method Details
#human_column_names ⇒ Object
6 7 8 |
# File 'lib/table_for/table.rb', line 6 def human_column_names columns.map { |column| model_class.human_attribute_name(column) } end |
#render ⇒ Object
14 15 16 17 18 |
# File 'lib/table_for/table.rb', line 14 def render content_tag(:table, :class => css_class) do + capture(TableBuilder.new(self), &block) end end |
#row_builders ⇒ Object
10 11 12 |
# File 'lib/table_for/table.rb', line 10 def row_builders records.map { |record| RowBuilder.new(self, record) } end |