In urls and rails routing, what is the difference between using a slash character vs a pound sign (hash sign) character?
These work
get "/static_pages/about"
get 'about', to: 'static_pages#about', as: :about
These don't
get "/static_pages#about"
get 'about', to: 'static_pages/about', as: :about
get 'about', to: '/static_pages#about', as: :about
What code controls this behavior, and what is the deeper reason behind it?
ANSWER:
(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.)
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.
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.