Module: StockHelper
- Defined in:
- app/helpers/stock_helper.rb
Instance Method Summary collapse
-
#stock_states_as_collection ⇒ Object
Provide translated stock states for select fields.
-
#t_stock_state(state) ⇒ Object
Translate stock state.
Instance Method Details
#stock_states_as_collection ⇒ Object
Provide translated stock states for select fields
8 9 10 11 12 13 14 |
# File 'app/helpers/stock_helper.rb', line 8 def stock_states_as_collection states = Stock::STATES states.inject({}) do |result, state| result[t_stock_state(state)] = state result end end |
#t_stock_state(state) ⇒ Object
Translate stock state
3 4 5 |
# File 'app/helpers/stock_helper.rb', line 3 def t_stock_state(state) t(state, :scope => 'stock.state') end |