From f2f7f7e96eede1a44afa49beb1040611a7a3b4dc Mon Sep 17 00:00:00 2001 From: Laurence de Bruxelles Date: Tue, 23 Jun 2026 11:08:58 +0300 Subject: [PATCH 1/2] Update link text for back links to add and edit your questions page Back links that always go back to the "Add and edit your questions" page should read "Back to your questions". This commit adds a translation in the back link section and uses this where appropriate. --- app/controllers/pages/routes_controller.rb | 3 +-- app/views/pages/change_order.html.erb | 2 +- app/views/pages/routes/show.html.erb | 2 +- app/views/routes/show.html.erb | 2 +- config/locales/en.yml | 2 +- spec/views/pages/routes/show.html.erb_spec.rb | 12 ++++++------ spec/views/routes/show.html.erb_spec.rb | 2 +- 7 files changed, 12 insertions(+), 13 deletions(-) diff --git a/app/controllers/pages/routes_controller.rb b/app/controllers/pages/routes_controller.rb index c3130e8c23..bc3ec20a14 100644 --- a/app/controllers/pages/routes_controller.rb +++ b/app/controllers/pages/routes_controller.rb @@ -1,9 +1,8 @@ class Pages::RoutesController < PagesController def show - back_link_url = form_pages_path(current_form.id) route_summary_card_data_presenter = RouteSummaryCardDataPresenter.new(form: current_form, page:) - render locals: { current_form:, page:, back_link_url:, route_summary_card_data_presenter: } + render locals: { current_form:, page:, route_summary_card_data_presenter: } end def delete diff --git a/app/views/pages/change_order.html.erb b/app/views/pages/change_order.html.erb index 6b221bc4fc..69b2022af4 100644 --- a/app/views/pages/change_order.html.erb +++ b/app/views/pages/change_order.html.erb @@ -1,5 +1,5 @@ <% set_page_title(title_with_error_prefix(t("page_titles.change_page_order"), @change_order_input.errors.any?)) %> -<% content_for :back_link, govuk_back_link_to(form_pages_path(@change_order_input.form.id), t("pages.change_order.back_link")) %> +<% content_for :back_link, govuk_back_link_to(form_pages_path(@change_order_input.form.id), t("back_link.form_pages")) %>
diff --git a/app/views/pages/routes/show.html.erb b/app/views/pages/routes/show.html.erb index 3f886a080f..0c5982ed46 100644 --- a/app/views/pages/routes/show.html.erb +++ b/app/views/pages/routes/show.html.erb @@ -1,5 +1,5 @@ <% set_page_title(title_with_error_prefix(t('page_titles.routes_show', question_number: page.position), false)) %> -<% content_for :back_link, govuk_back_link_to(back_link_url, t('pages.go_to_your_questions')) %> +<% content_for :back_link, govuk_back_link_to(form_pages_path(current_form.id), t('back_link.form_pages')) %>
diff --git a/app/views/routes/show.html.erb b/app/views/routes/show.html.erb index 01c9cc7a67..bbbad52261 100644 --- a/app/views/routes/show.html.erb +++ b/app/views/routes/show.html.erb @@ -1,5 +1,5 @@ <% set_page_title(t("page_titles.routes")) %> -<% content_for :back_link, govuk_back_link_to(form_pages_path(@current_form.id), t("back_link.form_view")) %> +<% content_for :back_link, govuk_back_link_to(form_pages_path(@current_form.id), t("back_link.form_pages")) %>
diff --git a/config/locales/en.yml b/config/locales/en.yml index 39f5c5da73..ccc59dac59 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -228,6 +228,7 @@ en: back_link: form_create: Back to create your form form_edit: Back to edit your form + form_pages: Back to your questions form_view: Back to your form forms: Back to your forms group: Back to %{group_name} @@ -1696,7 +1697,6 @@ en: pages: answer_settings: Answer settings change_order: - back_link: Back to Add and edit your questions move_question_to_label: Move question %{position} to (optional) preview_banner: You need to save this question order if you want to keep these changes preview_button: Preview new question order diff --git a/spec/views/pages/routes/show.html.erb_spec.rb b/spec/views/pages/routes/show.html.erb_spec.rb index d5d9f04c96..f395bf7701 100644 --- a/spec/views/pages/routes/show.html.erb_spec.rb +++ b/spec/views/pages/routes/show.html.erb_spec.rb @@ -26,7 +26,7 @@ context "when there are no routes" do before do - render template: "pages/routes/show", locals: { current_form: form, page:, back_link_url: "/back", route_summary_card_data_presenter: route_summary_card_data_service } + render template: "pages/routes/show", locals: { current_form: form, page:, route_summary_card_data_presenter: route_summary_card_data_service } end it "has the correct title" do @@ -34,7 +34,7 @@ end it "has the correct back link" do - expect(view.content_for(:back_link)).to have_link(I18n.t("pages.go_to_your_questions"), href: "/back") + expect(view.content_for(:back_link)).to have_link(I18n.t("back_link.form_pages"), href: form_pages_path(form.id)) end it "has the correct heading and caption" do @@ -68,7 +68,7 @@ create :condition, routing_page_id: pages.first.id, check_page_id: pages.first.id, answer_value: "Option 1", goto_page_id: pages.third.id pages.each(&:reload) - render template: "pages/routes/show", locals: { current_form: form, page:, back_link_url: "/back", route_summary_card_data_presenter: route_summary_card_data_service } + render template: "pages/routes/show", locals: { current_form: form, page:, route_summary_card_data_presenter: route_summary_card_data_service } end it "does not have a link to delete all routes" do @@ -120,7 +120,7 @@ create :condition, :with_exit_page, routing_page_id: page.id, check_page_id: page.id, answer_value: "Option 1" pages.each(&:reload) - render template: "pages/routes/show", locals: { current_form: form, page:, back_link_url: "/back", route_summary_card_data_presenter: route_summary_card_data_service } + render template: "pages/routes/show", locals: { current_form: form, page:, route_summary_card_data_presenter: route_summary_card_data_service } end it "does not show the link to set questions to skip" do @@ -140,7 +140,7 @@ create :condition, routing_page_id: pages.second.id, check_page_id: pages.first.id, goto_page_id: pages.fourth.id pages.each(&:reload) - render template: "pages/routes/show", locals: { current_form: form, page:, back_link_url: "/back", route_summary_card_data_presenter: route_summary_card_data_service } + render template: "pages/routes/show", locals: { current_form: form, page:, route_summary_card_data_presenter: route_summary_card_data_service } end it "has a link to delete all routes" do @@ -157,7 +157,7 @@ let(:errors) { [OpenStruct.new(link: "goto-1", message: "Error text")] } before do - render template: "pages/routes/show", locals: { current_form: form, page:, back_link_url: "/back", route_summary_card_data_presenter: route_summary_card_data_service } + render template: "pages/routes/show", locals: { current_form: form, page:, route_summary_card_data_presenter: route_summary_card_data_service } end it "shows the error message" do diff --git a/spec/views/routes/show.html.erb_spec.rb b/spec/views/routes/show.html.erb_spec.rb index 5ec81a0147..d247d635ae 100644 --- a/spec/views/routes/show.html.erb_spec.rb +++ b/spec/views/routes/show.html.erb_spec.rb @@ -18,7 +18,7 @@ def render_page it "has the correct back link" do render_page - expect(view.content_for(:back_link)).to have_link("Back to your form", href: form_pages_path(form.id)) + expect(view.content_for(:back_link)).to have_link("Back to your questions", href: form_pages_path(form.id)) end it "has the correct heading and caption" do From eaa566bf2290c527f00391292c11aa99129c43aa Mon Sep 17 00:00:00 2001 From: Laurence de Bruxelles Date: Tue, 23 Jun 2026 11:10:21 +0300 Subject: [PATCH 2/2] Update translation key Change key for translation of "Back to your questions" to better match the content. --- app/views/pages/_form.html.erb | 2 +- app/views/pages/address_settings.html.erb | 2 +- app/views/pages/conditions/routing_page.html.erb | 2 +- app/views/pages/date_settings.html.erb | 2 +- app/views/pages/edit.html.erb | 2 +- app/views/pages/guidance.html.erb | 2 +- app/views/pages/name_settings.html.erb | 2 +- app/views/pages/question_text.html.erb | 2 +- app/views/pages/routes/show.html.erb | 2 +- app/views/pages/selection/bulk_options.html.erb | 2 +- app/views/pages/selection/none_of_the_above.html.erb | 2 +- app/views/pages/selection/options.html.erb | 2 +- app/views/pages/selection/type.html.erb | 2 +- app/views/pages/text_settings.html.erb | 2 +- app/views/pages/type_of_answer.html.erb | 2 +- config/locales/en.yml | 2 +- spec/views/pages/routes/show.html.erb_spec.rb | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/app/views/pages/_form.html.erb b/app/views/pages/_form.html.erb index c5bb4c03b8..bb4b646127 100644 --- a/app/views/pages/_form.html.erb +++ b/app/views/pages/_form.html.erb @@ -71,7 +71,7 @@ <% end %> <% end %>
  • - <%= govuk_link_to t('pages.go_to_your_questions'), form_pages_path(form_object.id) %> + <%= govuk_link_to t('pages.back_to_your_questions'), form_pages_path(form_object.id) %>
  • <% end %> diff --git a/app/views/pages/address_settings.html.erb b/app/views/pages/address_settings.html.erb index 0b6585ee2d..df29034cb2 100644 --- a/app/views/pages/address_settings.html.erb +++ b/app/views/pages/address_settings.html.erb @@ -13,7 +13,7 @@ <% end %>

    - <%= govuk_link_to t('pages.go_to_your_questions'), form_pages_path(current_form.id) %> + <%= govuk_link_to t('pages.back_to_your_questions'), form_pages_path(current_form.id) %>

    diff --git a/app/views/pages/conditions/routing_page.html.erb b/app/views/pages/conditions/routing_page.html.erb index 828b3126be..7274269e18 100644 --- a/app/views/pages/conditions/routing_page.html.erb +++ b/app/views/pages/conditions/routing_page.html.erb @@ -17,7 +17,7 @@ <% end %>

    - <%= govuk_link_to t('pages.go_to_your_questions'), form_pages_path(form.id) %> + <%= govuk_link_to t('pages.back_to_your_questions'), form_pages_path(form.id) %>

    diff --git a/app/views/pages/date_settings.html.erb b/app/views/pages/date_settings.html.erb index d45a0132be..c862cbca0f 100644 --- a/app/views/pages/date_settings.html.erb +++ b/app/views/pages/date_settings.html.erb @@ -17,7 +17,7 @@ <% end %>

    - <%= govuk_link_to t('pages.go_to_your_questions'), form_pages_path(current_form.id) %> + <%= govuk_link_to t('pages.back_to_your_questions'), form_pages_path(current_form.id) %>

    diff --git a/app/views/pages/edit.html.erb b/app/views/pages/edit.html.erb index 3f45cae278..d0730a9170 100644 --- a/app/views/pages/edit.html.erb +++ b/app/views/pages/edit.html.erb @@ -12,7 +12,7 @@ <% end %>
  • - <%= govuk_link_to t("pages.go_to_your_questions"), form_pages_path(current_form.id) %> + <%= govuk_link_to t("pages.back_to_your_questions"), form_pages_path(current_form.id) %>
  • <% end%> diff --git a/app/views/pages/guidance.html.erb b/app/views/pages/guidance.html.erb index 57379fd6c5..aacc139ab3 100644 --- a/app/views/pages/guidance.html.erb +++ b/app/views/pages/guidance.html.erb @@ -39,7 +39,7 @@ <% end %>

    - <%= govuk_link_to t('pages.go_to_your_questions'), form_pages_path(current_form.id) %> + <%= govuk_link_to t('pages.back_to_your_questions'), form_pages_path(current_form.id) %>

    diff --git a/app/views/pages/name_settings.html.erb b/app/views/pages/name_settings.html.erb index 510aee4131..bbe1ef4033 100644 --- a/app/views/pages/name_settings.html.erb +++ b/app/views/pages/name_settings.html.erb @@ -32,7 +32,7 @@ <% end %>

    - <%= govuk_link_to t('pages.go_to_your_questions'), form_pages_path(current_form.id) %> + <%= govuk_link_to t('pages.back_to_your_questions'), form_pages_path(current_form.id) %>

    diff --git a/app/views/pages/question_text.html.erb b/app/views/pages/question_text.html.erb index 9482cc40f2..ccb2562298 100644 --- a/app/views/pages/question_text.html.erb +++ b/app/views/pages/question_text.html.erb @@ -10,7 +10,7 @@ <% end %>

    - <%= govuk_link_to t('pages.go_to_your_questions'), form_pages_path(current_form.id) %> + <%= govuk_link_to t('pages.back_to_your_questions'), form_pages_path(current_form.id) %>

    diff --git a/app/views/pages/routes/show.html.erb b/app/views/pages/routes/show.html.erb index 0c5982ed46..63df824e70 100644 --- a/app/views/pages/routes/show.html.erb +++ b/app/views/pages/routes/show.html.erb @@ -42,6 +42,6 @@ <% end %>

    - <%= govuk_link_to t("pages.go_to_your_questions"), form_pages_path(current_form.id) %> + <%= govuk_link_to t("pages.back_to_your_questions"), form_pages_path(current_form.id) %>

    diff --git a/app/views/pages/selection/bulk_options.html.erb b/app/views/pages/selection/bulk_options.html.erb index 343f2b7199..3cd799d05b 100644 --- a/app/views/pages/selection/bulk_options.html.erb +++ b/app/views/pages/selection/bulk_options.html.erb @@ -43,7 +43,7 @@ <% end %>

    - <%= govuk_link_to t('pages.go_to_your_questions'), form_pages_path(current_form.id) %> + <%= govuk_link_to t('pages.back_to_your_questions'), form_pages_path(current_form.id) %>

    diff --git a/app/views/pages/selection/none_of_the_above.html.erb b/app/views/pages/selection/none_of_the_above.html.erb index 533076dcf4..8827456510 100644 --- a/app/views/pages/selection/none_of_the_above.html.erb +++ b/app/views/pages/selection/none_of_the_above.html.erb @@ -23,7 +23,7 @@ <% end %>

    - <%= govuk_link_to t('pages.go_to_your_questions'), form_pages_path(current_form.id) %> + <%= govuk_link_to t('pages.back_to_your_questions'), form_pages_path(current_form.id) %>

    diff --git a/app/views/pages/selection/options.html.erb b/app/views/pages/selection/options.html.erb index 907627ebf8..6a9a828d13 100644 --- a/app/views/pages/selection/options.html.erb +++ b/app/views/pages/selection/options.html.erb @@ -66,7 +66,7 @@ <% end %>

    - <%= govuk_link_to t('pages.go_to_your_questions'), form_pages_path(current_form.id) %> + <%= govuk_link_to t('pages.back_to_your_questions'), form_pages_path(current_form.id) %>

    diff --git a/app/views/pages/selection/type.html.erb b/app/views/pages/selection/type.html.erb index 6f42bf7e14..8be052e3da 100644 --- a/app/views/pages/selection/type.html.erb +++ b/app/views/pages/selection/type.html.erb @@ -39,7 +39,7 @@ <% end %>

    - <%= govuk_link_to t('pages.go_to_your_questions'), form_pages_path(current_form.id) %> + <%= govuk_link_to t('pages.back_to_your_questions'), form_pages_path(current_form.id) %>

    diff --git a/app/views/pages/text_settings.html.erb b/app/views/pages/text_settings.html.erb index 8f93361b18..f393e2c7d8 100644 --- a/app/views/pages/text_settings.html.erb +++ b/app/views/pages/text_settings.html.erb @@ -17,7 +17,7 @@ <% end %>

    - <%= govuk_link_to t('pages.go_to_your_questions'), form_pages_path(current_form.id) %> + <%= govuk_link_to t('pages.back_to_your_questions'), form_pages_path(current_form.id) %>

    diff --git a/app/views/pages/type_of_answer.html.erb b/app/views/pages/type_of_answer.html.erb index 2984ab900b..5757a07729 100644 --- a/app/views/pages/type_of_answer.html.erb +++ b/app/views/pages/type_of_answer.html.erb @@ -27,7 +27,7 @@ <% end %>

    - <%= govuk_link_to t('pages.go_to_your_questions'), form_pages_path(current_form.id) %> + <%= govuk_link_to t('pages.back_to_your_questions'), form_pages_path(current_form.id) %>

    diff --git a/config/locales/en.yml b/config/locales/en.yml index ccc59dac59..3a5a5be357 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1696,6 +1696,7 @@ en: your_welsh_form_is_live: Your Welsh form is live pages: answer_settings: Answer settings + back_to_your_questions: Back to your questions change_order: move_question_to_label: Move question %{position} to (optional) preview_banner: You need to save this question order if you want to keep these changes @@ -1792,7 +1793,6 @@ en: edit: back_link: Back to edit route 1 delete_exit_page: Delete exit page - go_to_your_questions: Back to your questions heading: Edit question index: add_a_question_route: Add a question route diff --git a/spec/views/pages/routes/show.html.erb_spec.rb b/spec/views/pages/routes/show.html.erb_spec.rb index f395bf7701..ec60b2fc04 100644 --- a/spec/views/pages/routes/show.html.erb_spec.rb +++ b/spec/views/pages/routes/show.html.erb_spec.rb @@ -53,7 +53,7 @@ end it "has a back to questions link" do - expect(rendered).to have_link(I18n.t("pages.go_to_your_questions"), href: form_pages_path(form.id)) + expect(rendered).to have_link(I18n.t("pages.back_to_your_questions"), href: form_pages_path(form.id)) end it "does not have a link to delete all routes" do