折叠后,Bootstrap / Rails导航栏不会关闭

时间:2016-07-05 16:35:48

标签: jquery html ruby-on-rails twitter-bootstrap twitter-bootstrap-3

我已经在Stack Overflow上查看了其他解决方案,但它们似乎都不起作用。任何帮助表示赞赏。折叠的导航栏将打开,但是当我点击按钮关闭它时,它只会闪烁并保持打开状态。

这是我的导航栏代码:

<nav role="navigation" class="navbar navbar-default navbar-fixed-top">
<div class="container">

<!-- Title -->


<button class="navbar-toggle" data-toggle="collapse" data-target=".navHeaderCollapse">

  <span class="icon-bar"></span>
  <span class="icon-bar"></span>
  <span class="icon-bar"></span>

</button>

<!-- Additional navbar items -->
<div id="navHeaderCollapse" class="collapse navbar-collapse navbar-right navHeaderCollapse">
  <!--                      pull-right keeps the drop-down in line -->
  <ul class="nav navbar-nav pull-right">

    <li class="<%= 'active' if current_page?(root_path) %>"><% yield (:home)%><%= link_to "Home", root_path%></li>
    <li class="<%= 'active' if current_page?(services_path) %>"><% yield (:services)%><%= link_to "Services", services_path%></li>
    <li class="<%= 'active' if current_page?(careers_path) %>"><% yield (:careers)%><%= link_to "Careers", careers_path%></li>
    <li class="<%= 'active' if current_page?(contact_path) %>"><% yield (:contact)%><%= link_to "Contact Us", contact_path %>
    <li class="<%= 'active' if current_page?(about_us_path) %>"><% yield (:about_us)%><%= link_to "About Us", about_us_path%></li>

  </ul>
  </ul>
</div>

1 个答案:

答案 0 :(得分:0)

你有Building wheels for collected packages: MarkupSafe, SQLAlchemy, pycrypto Running setup.py bdist_wheel for MarkupSafe: started Running setup.py bdist_wheel for MarkupSafe: finished with status 'error' . . . Failed to build wheel for MarkupSafe Running setup.py bdist_wheel for SQLAlchemy: started Running setup.py bdist_wheel for SQLAlchemy: finished with status 'error' . . . Failed to build wheel for SQLAlchemy Running setup.py bdist_wheel for pycrypto: started Running setup.py bdist_wheel for pycrypto: finished with status 'error' . . . Failed to build wheel for pycrypto Failed to build MarkupSafe SQLAlchemy pycrypto 吗?试试吧。

另外,你有:

//= require bootstrap on application.js

@import 'bootstrap-sprockets'; @import 'bootstrap';