Refactor controller actions and views for page delete confirmation #1659
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What problem does this pull request solve?
Trello card: https://trello.com/c/UThSZ8ga/2037-fix-behaviour-of-deleting-page-with-secondary-skip-route
We want to be able to add some extra warnings and information to the confirmation page shown to users when they try to delete a question in a form.
However, to do this, we need to do some refactoring first, because currently the code for deleting pages is tangled up with the code for deleting forms.
This PR refactors the forms delete confirmation controller to deal with forms only, and moves the code for deleting pages to the pages controller; it is more idiomatic Rails to have the destroy and delete actions for a model in the controller for that model.
While working on this change I also noticed that there's an extra bit of hint text which is supposed to be shown to users when deleting a live form. It currently is not due to a typo, but it's also inaccurate as we haven't yet fully implemented deleting a form draft. So this PR just removes that hint text completely.
The changes in this PR should be purely refactors and not result in any user facing changes.
Things to consider when reviewing