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
14 15 16 |
# File 'app/helpers/eac_rails_utils/data_table_helper/data_table/value_cell.rb', line 14 def result view.content_tag('td', column.record_value(record), tag_attributes) end |
#tag_attribute_value(value) ⇒ 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_attributes ⇒ 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 # rubocop:disable Style/HashTransformValues, Style/MapToHash end |