Is there any way to control the float format in a form field?
I want to format a float like an integer if the modulus is 0, otherwise display the float as is. I overrode the Model accessor to do this formatting.
When an edit form is loaded, I would like to have the following transformations:
stored value | accessor returns | form field shows
---------------------------------------------------
1.0 | 1 | 1
1.5 | 1.5 | 1.5
However, form_for appears to be accessing the attribute directly, thereby displaying the float as is.
Any ideas on how to get around this? Thanks.