I need to save a field as 0 in a table
I have set the Default value as 0, for ‘number_of_days’ field in ‘tasks’
I have a form which has this field.
When I set the field empty(blank field!) and save the form, it is saved
But I want this to be saved as 0.
I am using
<% remote_form_for(:task, :url => tasks_path) do |f| %>
and in ‘create’ method I save as @task.save
I have an idea of explicitly assigning zero
But I want an alternative best approach without explicit assignment.
Thanks in advance…