title: Replace GET params in redirect_to request.referer
body: <p>I'm trying to Replace GET params in:</p>
  
  <pre><code>redirect_to request.referer
  </code></pre>
  
  <p>My request.referer already contains one parameter:</p>
  
  <pre><code>http://www.foo.com/bar?par=10
  </code></pre>
  
  <p>When i try:</p>
  
  <pre><code>redirect_to request.referer, :par =&gt; 5
  </code></pre>
  
  <p>it doesn't work. It redirects to referer but doesn't change :par from 10 to 5.
  When i do redirect to url_path, e.g.</p>
  
  <pre><code>redirect_to root_path, :par =&gt; 5
  </code></pre>
  
  <p>This works ok, redirects to:</p>
  
  <pre><code>http://www.foo.com/?par=5
  </code></pre>
  
  <p>So my question is how to replace params in request.referer URI. Additional question is whether should I use request.referer or :back ?</p>
  
  <p>Thanks</p>