SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
Thread: Keeping Nav Current
Threaded View
-
Feb 8, 2006, 16:19 #1
- Join Date
- Feb 2006
- Posts
- 7
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Keeping Nav Current
Hey, I am wondering how I might be able to adjust the code below to add an id to the links so that I can display that I am on a certain page in the nav.
Code:<ul id="nav"> <li><%= link_to "Blog", :action => "section", :id => 1 %></li> <li><%= link_to "About", :action => "section", :id => 2 %></li> <li><%= link_to "Contact", :action => "section", :id => 3 %></li> </ul>
Code:<ul id="nav"> <li><%= link_to_unless_current "Blog", :action => "section", :id => 1 %></li> <li><%= link_to_unless_current "About", :action => "section", :id => 2 %></li> <li><%= link_to_unless_current "Contact", :action => "section", :id => 3 %></li> </ul>
Code:<ul id="nav"> <li><a href="section/1">Blog</a></li> <li><a href="section/2" id="current">About</a></li> <li><a href="section/3">Contact</a></li> </ul>
Bookmarks