Module: Workarea::Admin::GlobalEHelpers

Defined in:
app/helpers/workarea/admin/global_e_helpers.rb

Instance Method Summary collapse

Instance Method Details

#currency_options(filtered_currencies = []) ⇒ Object



4
5
6
7
8
9
10
# File 'app/helpers/workarea/admin/global_e_helpers.rb', line 4

def currency_options(filtered_currencies = [])
  filtered_currencies += [Money.default_currency]

  [["---", nil]] + (all_currencies - filtered_currencies).map do |currency|
    ["#{currency.name} (#{currency.symbol})", currency.iso_code]
  end.compact
end

#global_e_country_optionsObject



12
13
14
15
16
17
# File 'app/helpers/workarea/admin/global_e_helpers.rb', line 12

def global_e_country_options
  [["---", nil]] + GlobalE.config.countries.map do |alpha2|
    next unless country = Country[alpha2]
    [country.name, alpha2]
  end.compact
end