I have a card and two nav-pills, and content on it.
<ul class="nav nav-pills">
<li class="nav-item active"><a class="nav-link active" href="#summary" data-toggle="tab"><%= t('summary') %></a></li>
<li class="nav-item"><a class="nav-link" href="#time" data-toggle="tab"><%= t('time_label') %></a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="summary">
// Some content...
</div>
<div class="tab-pane" id="time">
// Some content...
</div>
</div>
I have some API calls to make to a rails controller in the time pane,to a xyz controller action, which calls a file xyz.js.erb which has a window.location.reload() call to refresh the data, which restores the page, and opens the summary tab.
I want to retain focus on the time tab if that controller action was called, but window.location.reload() renders the page html again and opens summary tab. I do not want to store the href in a hash since I know exactly which tab to open. I also need to reload the page to refresh the data.
Any ideas?