I have a users controller which is used for users profile
then i routed from
/users/{username}
to
/{username}
but now if i want to add pages like
- About Us
- Help
- Contact Us
- ToS
- Privacy
- etc…
i face a problem where i cant access which page i am at via the params[] code
my route looks like
match '/home' => 'home#index'
#change /users/{username} to /{username}
match '/:username' => 'users#show'
i need to know which page i am for my navigation menu so i can add an active class to highlight the page
is there any way i can do this?
problem solved by checking which controller i am using
params[:controller]in the if conditional