title: Rails - redirect to current url without one of the GET params
body: <p>I have a very simple problem in a Rails app that I can't find an elegant solution to.</p>
  
  <p>I have a URL like: 
  <a href="http://www.example.com/some-path/?foo=123&amp;baz=456" rel="noreferrer">http://www.example.com/some-path/?foo=123&amp;baz=456</a></p>
  
  <p>And I want to process one of the params and do a redirect to:
  <a href="http://www.example.com/some-path/?baz=456" rel="noreferrer">http://www.example.com/some-path/?baz=456</a></p>
  
  <p>I want this to work generally for any URL with param "foo", so I don't want to specify "baz" in the rewrite code.</p>
  
  <p>What I want is something like:</p>
  
  <pre><code>redirect_to request.path, :params =&gt; request.query_parameters.except(:foo)
  </code></pre>
  
  <p>Except that doesn't quite work.  I know I can regex or parse the query string manually but I assume there's a better way.</p>