Module: ActionView::Helpers::ToCurrencySelectTag

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

Overview

Tag.

Instance Method Summary collapse

Instance Method Details

#to_currency_select_tag(priority_currencies, options, html_options) ⇒ Object



121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/currency_select.rb', line 121

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.zero?
            value()
          else
            value(object)
          end
  (
    'select',
    add_options(
      currency_options_for_select(value, priority_currencies),
      options,
      value
    ),
    html_options
  )
end