Class: EacRailsUtils::DataTableHelper::DataTable::ValueCell

Inherits:
Object
  • Object
show all
Defined in:
app/helpers/eac_rails_utils/data_table_helper/data_table/value_cell.rb

Instance Method Summary collapse

Instance Method Details

#resultActiveSupport::SafeBuffer

Returns:

  • (ActiveSupport::SafeBuffer)


14
15
16
# File 'app/helpers/eac_rails_utils/data_table_helper/data_table/value_cell.rb', line 14

def result
  view.('td', column.record_value(record), tag_attributes)
end

#tag_attribute_value(value) ⇒ Object

Returns:

  • (Object)


19
20
21
# File 'app/helpers/eac_rails_utils/data_table_helper/data_table/value_cell.rb', line 19

def tag_attribute_value(value)
  value.is_a?(::Proc) ? value.call(record) : value
end

#tag_attributesHash

Returns:

  • (Hash)


24
25
26
# File 'app/helpers/eac_rails_utils/data_table_helper/data_table/value_cell.rb', line 24

def tag_attributes
  column.value_cell_attributes.map { |k, v| [k, tag_attribute_value(v)] }.to_h
end