Class: View::Table::Column
- Inherits:
-
Struct
- Object
- Struct
- View::Table::Column
- Defined in:
- lib/view/formatters/table.rb
Instance Attribute Summary (collapse)
-
- (Object) attribute
Returns the value of attribute attribute.
-
- (Object) block
Returns the value of attribute block.
-
- (Object) options
Returns the value of attribute options.
-
- (Object) table
Returns the value of attribute table.
Instance Method Summary (collapse)
-
- (Hash) html_options
Html options to add to your td and th tags.
-
- (Object) name
Returns the name of the column.
Instance Attribute Details
- (Object) attribute
Returns the value of attribute attribute
118 119 120 |
# File 'lib/view/formatters/table.rb', line 118 def attribute @attribute end |
- (Object) block
Returns the value of attribute block
118 119 120 |
# File 'lib/view/formatters/table.rb', line 118 def block @block end |
- (Object) options
Returns the value of attribute options
118 119 120 |
# File 'lib/view/formatters/table.rb', line 118 def @options end |
- (Object) table
Returns the value of attribute table
118 119 120 |
# File 'lib/view/formatters/table.rb', line 118 def table @table end |
Instance Method Details
- (Hash) html_options
Html options to add to your td and th tags.
136 137 138 |
# File 'lib/view/formatters/table.rb', line 136 def { :class => attribute } end |
- (Object) name
Returns the name of the column. If the record extends ActiveModel::Translations, it will use human_attribute_name, which gets the translations from I18n. Otherwise it will just titleize the name of the attribute.
126 127 128 129 130 131 132 |
# File 'lib/view/formatters/table.rb', line 126 def name if resource_class.respond_to?(:human_attribute_name) resource_class.human_attribute_name(attribute) else attribute.to_s.titleize end end |