Module: Spree::Admin::StoreHelper

Includes:
LocaleHelper
Defined in:
app/helpers/spree/admin/store_helper.rb

Instance Method Summary collapse

Instance Method Details

#dimension_units(store = nil) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'app/helpers/spree/admin/store_helper.rb', line 22

def dimension_units(store = nil)
  store ||= current_store

  if store.metric_unit_system?
    [
      [Spree.t('dimension_units.centimeter'), 'cm'],
      [Spree.t('dimension_units.millimeter'), 'mm']
    ]
  else
    [
      [Spree.t('dimension_units.inch'), 'in'],
      [Spree.t('dimension_units.foot'), 'ft']
    ]
  end
end

#unit_systemsObject



38
39
40
41
42
43
# File 'app/helpers/spree/admin/store_helper.rb', line 38

def unit_systems
  [
    [Spree.t('unit_systems.metric_system'), 'metric'],
    [Spree.t('unit_systems.imperial_system'), 'imperial']
  ]
end

#weight_units(store = nil) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/helpers/spree/admin/store_helper.rb', line 6

def weight_units(store = nil)
  store ||= current_store

  if store.metric_unit_system?
    [
      [Spree.t('weight_units.kilogram'), 'kg'],
      [Spree.t('weight_units.gram'), 'g']
    ]
  else
    [
      [Spree.t('weight_units.pound'), 'lb'],
      [Spree.t('weight_units.ounce'), 'oz']
    ]
  end
end