So I have my table users
and each record has a username
field
and I have my root to controller main
and action `index
root :to => 'pages#main'
so if go to http://mydomain.com
It'll show my main#index
page and i have the about
and contact
pages as well.
but if i go to http://mydomain.com/Mr_Nizzle
it shows me the page of the user Mr_Nizzle
which is on users#show
(just like example) and as well for the other users to show every user's page...
is it right if i go =>
match ':username' => 'users#show'
match 'contact_us' => 'main#contact'
match 'about' => 'main#about'
root :to => 'pages#main'
so i can leave all the logic on route instead of in the main controller?
Thanks.