I want to copy the twitter profile page and have a url with a username \"http://www.my-app.com/username\" and while I can manually type this into the address bar and navigat
I know this questions is old but it will help someone.
You could try the below. I've used it in a rails 4 project and all seems to be working great. The reason for the as: :admin
is I also had a resources posts
outside of this scope. It will add a admin
to the helper calls e.g. admin_posts_path
scope ":username", module: 'admin', as: :admin do
get '', to: 'profiles#show'
resources :posts
end