Module: Reporta::BoxHelper
- Includes:
- ActionView::Helpers::NumberHelper
- Defined in:
- lib/reporta/box_helper.rb
Instance Method Summary collapse
Instance Method Details
#box_for(report, locals = {}) ⇒ Object
10 11 12 13 |
# File 'lib/reporta/box_helper.rb', line 10 def box_for(report, locals={}) locals.reverse_merge!(report: report) render partial: 'reporta/reports/box', locals: locals end |
#readable_number(num) ⇒ Object
4 5 6 7 8 |
# File 'lib/reporta/box_helper.rb', line 4 def readable_number(num) num = num || 0 opts = {units: { thousand: 'K', million: 'M', billion: 'B'}} number_to_human(num, opts) end |