我的ROR webapp的所有页面都有一个bootstrap导航栏(版本3.3.7 - 下面显示的代码)。它有两个下拉列表,大部分时间都很有用,但很多时候(大约10-15%的时间)它们会随机停止工作。
有时候所需要的只是快速页面刷新来设置事物,有时需要跳到多个不同的页面(或刷新多次)以使其再次工作 - 似乎没有确定的模式。虽然刷新页面几次并不是世界末日,但对于最终用户来说显然并不理想。有什么提示吗?
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand"><%= link_to "Home", root_path %></span>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><%= link_to "Dashboard", root_path %></li>
<li><%= link_to "Add", add_new_object_path %></li>
<li><%= link_to "Cards", cards_show_path %></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Stuff<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><%= link_to "Extra Resources", extra_resources_path %></li>
<li><%= link_to "Preferences", '#' %></li>
<li><%= link_to "Contact", '#' %></li>
<li><%= link_to "Help", '#' %></li>
<li><%= link_to "About", '#' %></li>
<li><%= link_to "Sign Out", destroy_user_session_path %></li>
</ul>
</li>
**<!-- this area (both above and below) is where it stops working sometimes -->**
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Teacher Tools<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><%= link_to "Verifications" %></li>
<li><%= link_to "Error Classification", new_correction_storage_path %></li>
</ul>
</li>
</ul>
<!-- TODO: not sure where to put the search bar currently! -->
<!-- defining the top padding with class="top-search" is maybe sub-optimal -->
<form class="form-inline float-xs-right top-search">
<input class="form-control" type="text" placeholder="Input a word or phrase">
<button class="btn btn-outline-success" type="submit">Langification</button>
</form>
</div><!--/.nav-collapse -->
</div>
</nav>