Skip to content

Commit

Permalink
Add query params to root route redirect.
Browse files Browse the repository at this point in the history
Live polling relies on a query string param with hits the root route. Ensure this param survives the redirect.
  • Loading branch information
ebiven committed Sep 12, 2024
1 parent 397f1a9 commit ef4f065
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/controllers/good_job/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ef4f065

Please sign in to comment.