Add money form field

This commit is contained in:
Artur Beljajev 2017-04-12 14:23:27 +03:00
parent bbabaf75f6
commit 42ee4fe804
3 changed files with 22 additions and 0 deletions

View file

@ -5,4 +5,11 @@ module FormHelper
file_field(object_name, method, options)
end
def money_field(object_name, method, options = {})
options[:pattern] = '^[0-9.]+$' unless options[:pattern]
options[:maxlength] = 255 unless options[:maxlength]
text_field(object_name, method, options)
end
end