Form entries with decimals generating float errors

I have “time estimated” and a “time spent” fields in my task form. In my
tasks table I have the “time_estimated” and “time_spent” rows assigned
as float types. I’ve also tried setting them to decimal (4,2) with no
luck.

When I submit the form the error reads “NoMethodError in
TasksController#create” then “Undefined method `size’ for 1.5:Float”.
The 1.5 is what I entered as a test in a form field declared with <%=
text_field ‘task’, ‘hours_estimated’, :size => 7 %>

Can anyone point me in the right direction?

Thanks,
DAN

I think I’m just gonna use varchar for now and then to_f in my list and
show views. At least validates_numericality_of doesn’t complain.

Not sure how else to handle non-currency decimal entries.

DAN

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs