Module: ActionView::Helpers::ToCurrencySelectTag

Included in:
CurrencySelectTag
Defined in:
lib/currency_select.rb

Instance Method Summary collapse

Instance Method Details

#to_currency_select_tag(priority_currencies, options, html_options) ⇒ Object



98
99
100
101
102
103
104
105
106
107
# File 'lib/currency_select.rb', line 98

def to_currency_select_tag(priority_currencies, options, html_options)
  html_options = html_options.stringify_keys
  add_default_name_and_id(html_options)
  value = if method(:value).arity == 0
            value()
          else
            value(object)
          end
  ('select', add_options(currency_options_for_select(value, priority_currencies), options, value), html_options)
end