Sha256: 6553eaea9dc127a4394eeb15912a09c5c801ab11c85cb47fd2b3fe028f88acb8
Contents?: true
Size: 984 Bytes
Versions: 10
Compression:
Stored size: 984 Bytes
Contents
module ActionView module Helpers module FormTagHelper # Create currency selector tag -- see select_tag for options def currency_select_tag(name, current_value, options={}) selectable_options = [] selectable_options << ["--", nil] if options[:include_blank] selectable_options += EnabledCurrency.all.map(&:iso_code) unless EnabledCurrency.all.empty? select_tag(name, options_for_select(selectable_options, current_value), options) end end module DateHelper def currency_select(object_name, method, options = {}) value = options[:object] || EnabledCurrency.base_currency currency_select_tag("#{object_name}[#{method}]", value, options.merge(:id => "#{object_name}_#{method}")) end end class FormBuilder def currency_select(method, options = {}) @template.currency_select(@object_name, method, options.merge(:object => @object.send(method))) end end end end
Version data entries
10 entries across 10 versions & 1 rubygems