title: How to override routes path helper in rails?
body: <p>My route is defined like this</p>
  
  <pre><code>match '/user/:id' =&gt; 'user#show', :as =&gt; :user
  </code></pre>
  
  <p>If for some reason a nil ID is passed I want the route helper to return only '#' and if ID is not nil i want it to return normal path like '/user/123'.
  or is there any better way to do it.
  this route helper has been used in lot of places in my code so I dont want to change that. Instead I am looking for one place which will effect all instances of user_path.</p>
  
  <p>Thanks</p>