title: Aliasing a Route in Rails
body: <p>I would like to alias the way the name of a route is displayed to the user in the address bar, in my routes at present i have</p>
  
  <pre><code>Myapp::Application.routes.draw do
    get 'pages/my_portfolio'
    match '/my_portfolio', :to =&gt; 'pages#my_portfolio'
  end
  </code></pre>
  
  <p>So i have a pages controller that has all my static pages, but rather than have the url show as</p>
  
  <pre><code>/my_portfolio
  </code></pre>
  
  <p>I would like it to show as </p>
  
  <pre><code>/my-portfolio
  </code></pre>
  
  <p>I have tried</p>
  
  <pre><code>match '/my_portfolio', :to =&gt; 'pages#my_portfolio', :as =&gt; 'my-portfolio'
  </code></pre>
  
  <p>but get an error</p>
  
  <pre><code>Invalid route name: 'my-portfolio' (ArgumentError) 
  </code></pre>
  
  <p>How can i achieve this?</p>
  
  <p>Thanks </p>