Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Build a Simple Ruby on Rails Application Frontend Development Adding Interactivity

Isn't there an easier way to toggle hover state?

Cant we just use this:

.status .admin { display: none; }

.status:hover .admin { display: inline; }

this would require no javascript or coffeescript. Just css.

2 Answers

Yes this is the way I did it. It's done the JS route due to the video being created prior to the :hover pseudo classes being available. So your route is correct.

yeah thanks. That's what i thought :)

No problem!

Yes. Definitely watch the sass lessons, once set up you can do:

.status .admin { 
    display: none; 
    &:hover{
        display: inline;
    }
}

Totally right, but I think the OP was referring to the unnecessary use of JS in the videos, rather than the use of the CSS/SCSS

good to know. thanks :)