Topic: Different CSS format for actions on the same object
I think this is a very simple thing but as a newb I just can't seem to figure it out....
All I am doing is trying to change the background color on the active link - which is working just fine for most pages. The problem I'm having is for the links that use named routes and point to different actions on the same object (edit a user and show a user). I can't figure out the CSS syntax for that. Appreciate the help!
Application Layout:
%nav
%ul
%li= link_to 'Home', root_url, :class => 'home'
- if signed_in?
%li= link_to 'Profile', current_user, :class => 'profile'
%li= link_to 'Settings', edit_user_path(current_user), :class => 'settings'
%li= link_to 'Products', products_url, :class => 'products'
%li= link_to 'Charts', charts_url, :class => 'charts'
Working CSS:
.home #top_header nav a.home,
.products #top_header nav a.products,
.charts #top_header nav a.charts,
.users #top_header nav a.profile,
.accounts #top_header nav a.accounts {
background-color: #333;
}
Not Working CSS:
.users .edit #top_header nav a.settings {background-color: #333}
Last edited by trac0328 (2011-06-17 11:19:14)