I need to highlight the link button that relates to the current page.
in apps/views/layouts/application.html.erb:
<ul class="nav nav-tabs">
<li class="link_style"><a href="/">link1</a></li>
<li class="link_style"><a href="/about">link2</a></li>
<li class="link_style"><a href="/posts">link3</a></li>
</ul>
and I plan to add the following to some .js file
$('li.link_style').on('click', function(){
$(this).addClass('active'); // and then add active class for clicked element.
});
I think this would work well. However, I'm not sure to which .js file I should add the js code. My guess is to /app/views/layouts/application.js.erb
Is my approach right?