Browse Source

Remove member from routes

pull/978/head
Kat 3 years ago
parent
commit
5705c99de0
  1. 4
      app/controllers/locations_controller.rb
  2. 4
      app/helpers/check_answers_helper.rb
  3. 2
      config/routes.rb

4
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

4
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)

2
config/routes.rb

@ -51,12 +51,10 @@ 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
end
end
resources :users do
get "edit-dpo", to: "users#dpo"

Loading…
Cancel
Save