From 5705c99de0b05f716ae5589a837bda98b93bed8f Mon Sep 17 00:00:00 2001 From: Kat Date: Wed, 9 Nov 2022 09:53:23 +0000 Subject: [PATCH] Remove member from routes --- app/controllers/locations_controller.rb | 4 ++-- app/helpers/check_answers_helper.rb | 4 ++-- config/routes.rb | 6 ++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/controllers/locations_controller.rb b/app/controllers/locations_controller.rb index 1759ac1d6..0a857bb13 100644 --- a/app/controllers/locations_controller.rb +++ b/app/controllers/locations_controller.rb @@ -23,7 +23,7 @@ class LocationsController < ApplicationController @location = Location.new(location_params) if @location.save if @location.location_admin_district.nil? - redirect_to(edit_local_authority_scheme_location_path(scheme_id: @scheme.id, id: @location.id, add_another_location: location_params[:add_another_location])) + redirect_to(scheme_location_edit_local_authority_path(scheme_id: @scheme.id, location_id: @location.id, add_another_location: location_params[:add_another_location])) elsif location_params[:add_another_location] == "Yes" redirect_to new_scheme_location_path(@scheme) else @@ -69,7 +69,7 @@ class LocationsController < ApplicationController case page when "edit" if @location.location_admin_district.nil? - redirect_to(location_edit_local_authority_path(id: @scheme.id, location_id: @location.id, add_another_location: location_params[:add_another_location])) + redirect_to(scheme_location_edit_local_authority_path(scheme_id: @scheme.id, location_id: @location.id, add_another_location: location_params[:add_another_location])) elsif location_params[:add_another_location] == "Yes" redirect_to(new_scheme_location_path(@location.scheme)) else diff --git a/app/helpers/check_answers_helper.rb b/app/helpers/check_answers_helper.rb index 0be14641c..1583b3791 100644 --- a/app/helpers/check_answers_helper.rb +++ b/app/helpers/check_answers_helper.rb @@ -18,14 +18,14 @@ module CheckAnswersHelper def get_location_change_link_href_postcode(scheme, location) if location.confirmed? - edit_name_scheme_location_path(scheme_id: scheme.id, id: location.id) + scheme_location_edit_name_path(scheme_id: scheme.id, location_id: location.id) else edit_scheme_location_path(scheme_id: scheme.id, id: location.id) end end def get_location_change_link_href_location_admin_district(scheme, location) - edit_local_authority_scheme_location_path(scheme_id: scheme.id, id: location.id) + scheme_location_edit_local_authority_path(scheme_id: scheme.id, location_id: location.id) end def any_questions_have_summary_card_number?(subsection, lettings_log) diff --git a/config/routes.rb b/config/routes.rb index 97bf743bb..eab3d3222 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -51,10 +51,8 @@ Rails.application.routes.draw do get "support-services-provider", to: "schemes#support_services_provider" resources :locations do - member do - get "edit-name", to: "locations#edit_name" - get "edit-local-authority", to: "locations#edit_local_authority" - end + get "edit-name", to: "locations#edit_name" + get "edit-local-authority", to: "locations#edit_local_authority" end end