# Link\_to\_unless\_current

**URL:** <https://www.ruby-forum.com/t/link-to-unless-current/184048>\
**Category:** Rails\
**Created:** [February 24, 2010, 8:47am UTC](https://www.ruby-forum.com/t/link-to-unless-current/184048 "2010-02-24T08:47:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SachinJ](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b9bd4f/32.png) [@SachinJ](https://www.ruby-forum.com/u/SachinJ)\
**Post date:** [February 24, 2010, 8:47am UTC](https://www.ruby-forum.com/t/link-to-unless-current/184048/1 "2010-02-24T08:47:52Z")

</div>

Hello Experts,  
I have a tabbed navigation in side which there are sub menus. For the  
tab, to look selected i have used the link\_to\_unless\_current which  
assigns appropriate css to the tab when it doesn’t have a URL.

When the user clicks on any of the link inside the tab, I want same  
top level tab to remain selected, but as per the  
link\_to\_unless\_current logic, when it is not current page it adds the  
link to the tab which changes the css and my tab starts looking non  
selected.

Is there any way by which i can define a few links under 1 tab, using  
the link\_to\_unless\_current logic.

- I previously have used a logic in which a controller sets a  
@current\_tab = ‘section\_name’ parameter and the tab with the  
particular section\_name gets selected.

I am just wondering if i can specify a hierarchy on a central place.

Thanks in advance…  
Sachin
