Saving Ruby Decimals in Form

164 views Asked by At

I have a Ruby attribute that I'm trying to save as part of a form that is:

t.decimal "fantasy_points", precision: 4, scale: 1

In my form I'm trying to use the input:

<%= f.text_field :fantasy_points, :value => number_with_precision(f.object.fantasy_points) %>

When use the form I get a success message but no value is saved and I get a 'nil' value in my database. However, I can still save a value manually in the console. I'm new to rails and any help would be great.

0

There are 0 answers