6
7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/amount_field/form_tag_helper.rb', line 6
def amount_field_tag(name, value = nil, options = {})
format_options = I18n.t(:'number.amount_field.format', :raise => true) rescue {}
format_options = format_options.merge(AmountField::ActiveRecord::Validations.configuration)
format_options.merge!(options.delete(:format) || {})
options[:value] ||= number_with_precision(value.to_s, format_options)
options[:name] = "#{AmountField::Configuration.prefix}_#{name}"
options[:class] = "#{options[:class]} #{AmountField::Configuration.css_class}"
text_field_tag(name, value, options)
end
|