From a6fc8afe7b21717327a835a80e0a3876d2a7bd80 Mon Sep 17 00:00:00 2001 From: JG Date: Fri, 16 Sep 2022 15:19:46 +0100 Subject: [PATCH] dynamic routes for specific new pages --- config/routes.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/config/routes.rb b/config/routes.rb index 12e996fcc..09be8a3cd 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -28,7 +28,13 @@ Rails.application.routes.draw do root to: "start#index" get "/logs", to: redirect("/lettings-logs") - get "/logs/new/organisation", to: "form#show_new_page" + + FormHandler.instance.forms.each do |_key, form| + form.pages.map do |page| + get "/logs/new/#{page.id.to_s.dasherize}", to: "form#show_new_page" + end + end + get "/accessibility-statement", to: "content#accessibility_statement" get "/privacy-notice", to: "content#privacy_notice" get "/data-sharing-agreement", to: "content#data_sharing_agreement"