If an info page has multiple tabs based on different topics and there are links leading to the info page from different pages, how do you link to the info page with an active tab depending on the link used?
I want to have a link like this:
<p>View the terms & conditions on our info page <%= link_to "here", info_path %>, thanks.</p>
Lead to my info page with the Terms tab active like this:
<li role="presentation">
<a href="#terms" class="active" aria-controls="terms" role="tab" data-toggle="tab">
<h2>Terms</h2>
<p>These are the terms.</p>
</a>
</li>
I was wondering how to change the "active" status based on the link from a different page on my site. Does the active status need to be changed on the specific tabpanel instead? Thank you!
This is the tab section from the info page:
<ul class="nav nav-tabs" role="tablist">
<li role="presentation">
<a href="#about" aria-controls="about" role="tab" data-toggle="tab">
About
</a>
</li>
<li role="presentation">
<a href="#advertise" aria-controls="advertise" role="tab" data-toggle="tab">
Advertise
</a>
</li>
<li role="presentation">
<a href="#legal" aria-controls="legal" role="tab" data-toggle="tab">
Legal
</a>
</li>
<li role="presentation">
<a href="#privacy" aria-controls="privacy" role="tab" data-toggle="tab">
Privacy
</a>
</li>
<li role="presentation">
<a href="#terms" aria-controls="terms" role="tab" data-toggle="tab">
Terms
</a>
</li>
</ul>
<!-- TAB PANES -->
<div class="tab-content" id="infoTabContent">
<!-- TAB DIVIDER -->
<div role="tabpanel" class="tab-pane fade in" id="about">
<h3>About</h3>
<div class="indent">
<p>This is the about tab using a div to indent lines</p>
</div>
</div>
<!-- TAB DIVIDER -->
<div role="tabpanel" class="tab-pane fade" id="advertise">
<h3>Advertise</h3>
</div>
<!-- TAB DIVIDER -->
<div role="tabpanel" class="tab-pane fade" id="legal">
<h3>Legal</h3>
</div>
<!-- TAB DIVIDER -->
<div role="tabpanel" class="tab-pane fade" id="privacy">
<h3>Privacy</h3>
</div>
<!-- TAB DIVIDER -->
<div role="tabpanel" class="tab-pane fade" id="terms">
<h3>Terms</h3>
</div>
<!-- TAB DIVIDER -->
</div><!-- Tab Content -->