Add exit pages update delete - #3024
Open
thomasiles wants to merge 9 commits into
Open
Conversation
When making changes to some models, we want to reset the question_section_completed flag and update the draft. We do this in some places by calling save_question_changes! after making the changes. To make this more consistent, we can add an optional block to save_question_changes! which will be called in the same transaction as the save. This allows us to pass our changes in a block and be sure the draft is updated. diff --git a/app/models/form.rb b/app/models/form.rb index 22cf9c7..7dc3f9c 100644 --- a/app/models/form.rb +++ b/app/models/form.rb @@ -51,11 +51,18 @@ class Form < ApplicationRecord attr_accessor :task_status_service
Creating a new exit page should create a new draft and set the question_section_completed flag to false.
ExitPages should only be added to pages that have selection options. This commit adds a before_action to check that the page can have exit pages before allowing the user to add, edit or delete them. If the shouldn't have exit pages, the user is redirected to a 404 page. The actions are ordered so that the permission check is first, followed by the others.
thomasiles
force-pushed
the
add-exit-pages-update-delete
branch
from
August 13, 2026 15:03
50535c8 to
e605106
Compare
|
🎉 A review copy of this PR has been deployed! You can reach it at: https://pr-3024.admin.review.forms.service.gov.uk/ It may take 5 minutes or so for the application to be fully deployed and working. If it still isn't ready For the sign in details and more information, see the review apps wiki page. |
thomasiles
marked this pull request as ready for review
August 13, 2026 15:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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/gecvdskV/3173-change-add-edit-delete-exit-page-to-work-with-multiple-branches
Add the update/delete exit page routes and make a few small improvements to the add exit page:
Things to consider when reviewing