Module: FormtasticCurrencySelect

Defined in:
lib/formtastic_currency_select.rb

Instance Method Summary collapse

Instance Method Details

#currency_input(method, options) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/formtastic_currency_select.rb', line 3

def currency_input(method, options)
  raise "To use the :currency input, please install the currency_select plugin http://github.com/gavinlaking/currency_select" unless self.respond_to?(:currency_select)

  html_options = options.delete(:input_html) || {}
  priority_currencies = options.delete(:priority_currencies) || ["US Dollar", "Euro"]

  self.label(method, options_for_label(options)) <<
    self.currency_select(method, priority_currencies, strip_formtastic_options(options), html_options)
end