From cfa885251c66bd9da31b0ab6fa8eea1b04991821 Mon Sep 17 00:00:00 2001 From: Kat Date: Wed, 19 Jul 2023 08:34:19 +0100 Subject: [PATCH] specs --- app/controllers/sessions_controller.rb | 3 ++- app/views/locations/_location_filters.html.erb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 59537bac2..225f05f8b 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -1,8 +1,9 @@ class SessionsController < ApplicationController def clear_filters session[session_name_for(params[:filter_type])] = "{}" + path_params = params[:path_params].presence || {} - redirect_to send("#{params[:filter_type]}_path", scheme_id: params[:path_params][:scheme_id]) + redirect_to send("#{params[:filter_type]}_path", scheme_id: path_params[:scheme_id]) end private diff --git a/app/views/locations/_location_filters.html.erb b/app/views/locations/_location_filters.html.erb index 1854d731b..d5bdeb156 100644 --- a/app/views/locations/_location_filters.html.erb +++ b/app/views/locations/_location_filters.html.erb @@ -5,7 +5,7 @@
- <%= form_with html: { method: :get } do |f| %> + <%= form_with url: scheme_locations_path(@scheme), html: { method: :get } do |f| %>

<%= filters_applied_text(@filter_type) %>