Class: EacRailsUtils::DataTableHelper::DataTable::ValueCell
- Inherits:
-
Object
- Object
- EacRailsUtils::DataTableHelper::DataTable::ValueCell
- Defined in:
- app/helpers/eac_rails_utils/data_table_helper/data_table/value_cell.rb
Instance Method Summary collapse
Instance Method Details
#result ⇒ ActiveSupport::SafeBuffer
12 13 14 |
# File 'app/helpers/eac_rails_utils/data_table_helper/data_table/value_cell.rb', line 12 def result view.content_tag('td', column.record_value(record), tag_attributes) end |
#tag_attribute_value(value) ⇒ Object
17 18 19 |
# File 'app/helpers/eac_rails_utils/data_table_helper/data_table/value_cell.rb', line 17 def tag_attribute_value(value) value.is_a?(::Proc) ? value.call(record) : value end |
#tag_attributes ⇒ Hash
22 23 24 |
# File 'app/helpers/eac_rails_utils/data_table_helper/data_table/value_cell.rb', line 22 def tag_attributes column.value_cell_attributes.map { |k, v| [k, tag_attribute_value(v)] }.to_h # rubocop:disable Style/HashTransformValues, Style/MapToHash end |