Topic: [SOLVED]Writing conditional HTML options for link_to(tabbed interface)
I am trying to implement tabbed navigation in my application. What i need is very simple. I need to set the id to "current" when a particular link_to(tab) is selected. The css takes care of the rest. My tabs are basically just link_to(s). i am able to set it n see the effect. But i need to set it only if that link is clicked, or if that controller is called. I have seen the tabbed navigation plugin in the widgets and the code seems a little too much for my need.
I have been trying to write a condition into the erb tags but its not working. Hope someone has a solution. Here's what i have
<%= link_to 'Dashboard', :controller => :dashboard, :action => :show%>
<%= link_to 'Companies', companies_path(), :id=>"current"%>#setting id like this with a condition is what i need
Also, passing the :id key and value seems to work only with RESTful routes. Does not work with controller/action specifications. Any thoughts on that?
Last edited by yourstruly_vinay (2008-10-11 05:08:55)