To create a Save as draft for an application form, we did this :
1. Created a Save option in the form and set the value to ‘draft’.
2. Migration to add a column called status to application model.
3. In create method of controller we have this logic to check if we want to save as a draft : if params[:commit] == ‘Save’. If yes, then set the application status value to ‘draft’. Coming to why we have to do this. ( Commit is the name attribute of the submit button )
4. So. Next. When we want to view the half completed form, we need to make sure that we’re showing the right thing. So, in the show method of controller, we’re checking the value of the status column. If it is a draft, render the appropriate form.
But no, this isn’t working. The form is simply not getting saved as a draft. It’s just getting published. I’m probably missing something.