From ef4f065448c7ed2c3ec64061004082d899dca326 Mon Sep 17 00:00:00 2001 From: Eric Biven Date: Thu, 12 Sep 2024 10:23:47 -0500 Subject: [PATCH] Add query params to root route redirect. Live polling relies on a query string param with hits the root route. Ensure this param survives the redirect. --- app/controllers/good_job/application_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/good_job/application_controller.rb b/app/controllers/good_job/application_controller.rb index 0d335d1f..4584fb0f 100644 --- a/app/controllers/good_job/application_controller.rb +++ b/app/controllers/good_job/application_controller.rb @@ -26,8 +26,9 @@ class ApplicationController < ActionController::Base end def index - # Redirect to the jobs page - redirect_to jobs_path + # Redirect to the jobs page, maintaining query parameters. This is + # necessary to support the `?poll=1` parameter that enables live polling. + redirect_to jobs_path(request.query_parameters) end private