Module: BulmaPhlex::Rails::TableHelper

Extended by:
ActiveSupport::Concern
Defined in:
lib/bulma_phlex/rails/helpers/table_helper.rb

Overview

# Table Helper

This module provides method ‘amount_column` to create an amount column in a table.

Instance Method Summary collapse

Instance Method Details

#amount_column(header, currency: {}, **html_attributes, &content) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/bulma_phlex/rails/helpers/table_helper.rb', line 15

def amount_column(header, currency: {}, **html_attributes, &content)
  html_attributes[:class] = [html_attributes[:class], "has-text-right"].compact.join(" ")

  column(header, **html_attributes) do |row|
    number_to_currency(content.call(row), **currency)
  end
end