Module: Noventius::CellsHelper

Defined in:
app/helpers/noventius/cells_helper.rb

Instance Method Summary collapse

Instance Method Details

#cell_for_row_column(report, row, column) ⇒ Object



18
19
20
# File 'app/helpers/noventius/cells_helper.rb', line 18

def cell_for_row_column(report, row, column)
  column.value(report, row)
end

#cell_tag(value) ⇒ Object



5
6
7
# File 'app/helpers/noventius/cells_helper.rb', line 5

def cell_tag(value)
  (:td, format_value(value))
end

#format_value(value) ⇒ Object



9
10
11
12
13
14
15
16
# File 'app/helpers/noventius/cells_helper.rb', line 9

def format_value(value)
  case value
  when Date, DateTime, Time
    l(value, format: :long)
  else
    value
  end
end