Reputation: 97
I am using bootstrap styling for nav tabs in form, I want to set the active tab depending on the value fetched from database in edit screen. Can anyone help me please?
Upvotes: 0
Views: 232
Reputation: 2810
Try this
<ul class="nav">
<li class="<%= 'active' if @model.some_value == 'value' %>" >
<%= link_to 'A', "#" %>
</li>
</ul>
Upvotes: 1