title: Rails Routes - slash character vs hash character
body: <p>In urls and rails routing, what is the difference between using a slash character vs a pound sign (hash sign) character?</p>
  
  <p>These work</p>
  
  <pre><code>get "/static_pages/about"
  get 'about', to: 'static_pages#about', as: :about
  </code></pre>
  
  <p>These don't</p>
  
  <pre><code>get "/static_pages#about"
  get 'about', to: 'static_pages/about', as: :about
  get 'about', to: '/static_pages#about', as: :about
  </code></pre>
  
  <p>What code controls this behavior, and what is the deeper reason behind it?</p>
  
  <p>ANSWER: </p>
  
  <p>(The two people answered it very well, and I had trouble choosing which one to mark as the accepted answer. I wish to state my understanding of the answer in a different way that might help people.)</p>
  
  <p>Once you use the / symbol, the string gets recognized as a url string appended to the base url. So a '#' character will be interpreted as part of the url, and urls don't like to take '#' characters. </p>
  
  <p>In the case of not using a / character, the first word is recognized somehow as a controller name, which you follow up with a '#' and an action name.</p>