Highlighting the current page in rails, only works for some pages
Posted
by raphael_turtle
on Stack Overflow
See other posts from Stack Overflow
or by raphael_turtle
Published on 2010-05-28T13:17:30Z
Indexed on
2010/05/28
13:22 UTC
Read the original article
Hit count: 130
ruby-on-rails
|css
I've used this tutorial to highlight the current page in the menu. I have a pages controller with a few static pages, for the home page I simply have
def home
@title = 'Home
and similar for contact pages etc.
Then in my main layout file I have <body class="<%= @title %>">
and this works fine to set the correct css, but how do I set @title for my other controllers where there's more than one action?
© Stack Overflow or respective owner