Topic: Forms without a supporting model
Few problems connected to the same theme.
First, how do i make a form with a input field which is not associated with anything in the model. I need to have a checkbox which signifies not to insert / update the date field on the table but to insert / update to null instead
i've been trying to no avail
params[:set_null] = "1"
params[:set_null] = "0"
check_box :set_null, @params[:set_null]
but it doesn't check the checkbox when it should - any ideas?
Second, when i have a record already in the DB and update it, I need to be able to change the date value back to null if the checkbox has been ticked. And i want to do it before calling update_attributes but
params[:record][:date_obtained] = nil
won't work - any help here appreciated greatly too