Hi guys,
I've searched high and low, but I could not find a solution, to what I think seems like a very common task.
In a form I want to have a text input that accepts currency strings (i.e. $1,000,000 or 1000 or $12.12 and in an ideal world even 1 million)
In the database I want to keep the value as a integer.
What is the best way to (a) validate that the input is a valid currency string, (b) when displaying the form, to display it formatted.
For date, i found the a great gem: validates_timeliness, which allows :
validates_date :my_date, :allow_blank => true
I would love to find a similar syntax for currency.
Thanks!