I have the following code and would like to add class="current"
to <li></li>
according to the controller I'm 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 the controller / action in the view?
I thought of getting the controller / action name and jQuery to change the <li></li>
class.