1
I have the code below and would like to add to class="current"
to <li></li>
according to the controller I am accessing.
I want to do this to make the item stand out.
<ul class="nav">
<!-- Main menu -->
<li class="current"><a href="index.html"><i class="glyphicon glyphicon-home"></i> Dashboard</a></li>
<li><a href="calendar.html"><i class="glyphicon glyphicon-calendar"></i> Calendar</a></li>
<li><a href="stats.html"><i class="glyphicon glyphicon-stats"></i> Statistics (Charts)</a></li>
<li><a href="tables.html"><i class="glyphicon glyphicon-list"></i> Tables</a></li>
<li><a href="forms.html"><i class="glyphicon glyphicon-tasks"></i> Forms</a></li>
<li class="submenu">
<a href="#">
<i class="glyphicon glyphicon-list"></i> Pages
<span class="caret pull-right"></span>
</a>
<!-- Sub menu -->
<ul>
<li><a href="login.html">Login</a></li>
<li><a href="signup.html">Signup</a></li>
</ul>
</li>
</ul>
How do I get the name of controller/action in the view?
I thought to take the name of the controller/action and through jQuery change the class of the <li></li>
.