Remove unused query parameters in redirect

These actions are never called with query parameters in our application,
so there's no need to use these parameters in a redirect.

Note in the test I'm using the `get` method because the `patch` method
wouldn't send query parameters. This doesn't mean the action can be
accessed through GET requests, since controller tests don't check route
verbs.
This commit is contained in:
Javi Martín
2019-11-10 02:03:57 +01:00
parent aef4651f0d
commit 941fc76884
2 changed files with 13 additions and 2 deletions

View File

@@ -37,12 +37,12 @@ class DebatesController < ApplicationController
def unmark_featured
@debate.update!(featured_at: nil)
redirect_to request.query_parameters.merge(action: :index)
redirect_to debates_path
end
def mark_featured
@debate.update!(featured_at: Time.current)
redirect_to request.query_parameters.merge(action: :index)
redirect_to debates_path
end
def disable_recommendations