Rails 4 Bootstrap 3 Nav Collapse扩展但不会再崩溃

时间:2014-11-22 19:04:32

标签: ruby-on-rails-4 twitter-bootstrap-3

崩溃扩张得很好,但不会再崩溃。我想也许我安装的多个Bootstrap宝石可能会有冲突。有没有简单的方法来测试?

这个应用程序已经存在,因为它是一个Rails 3应用程序,并且自从去年升级到4以后,除了这个之外它很好用。

我的宝石文件:

ruby '2.0.0'

gem 'rails', '4.0.2'
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails', '~> 3.1.0'
gem 'turbolinks'
gem 'jquery-turbolinks'
gem 'jbuilder', '~> 2.0.2'
gem 'bootstrap-sass', '~> 3.1.1.0'
gem 'twitter-bootstrap-rails', '~> 2.2.8'
gem 'devise', '~> 3.2.2'
gem 'simple_form'
gem "paperclip", "~> 4.2.0"
gem 'aws-sdk', '~> 1.32.0'
gem 'will_paginate', '3.0.5'
gem 'will_paginate-bootstrap'
gem "friendly_id", "~> 5.0.2"
gem 'faker', '1.2.0'
gem 'auto_html'
gem 'protected_attributes'
gem 'ckeditor', '~> 4.0.11'

我的导航栏:

<nav class="navbar navbar-static-top navbar-default" role="navigation">
  <div class="row header_row1">
    <div class="header_title">
      theTens
      <% if user_signed_in? %>
        <%= link_to (image_tag current_user.image(:small), class: "header_pic"), current_user %>
        <%= link_to 'New Review',  new_pin_path, class: "btn btn-danger new_review" %>
      <% else %> 
        <%= link_to "Sign Up Now!", new_user_registration_path, class: "btn btn-primary btn-large sign_up_button" %>
      <% end %>
    </div>
  </div>
  <div class="row header_row2">  
    <div class="navbar-header">
    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#tens_nav">
      <span class="sr-only">Toggle navigation</span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
    </button>
  </div>
    <div class="container">
      <div class="collapse navbar-collapse" id="tens_nav"> 
        <ul class="nav navbar-nav navbar-left">
          <li class="home">
            <%= link_to root_path do %>
              <span class="glyphicon glyphicon-home"></span>
            <% end %>  
          </li>

          <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown"> theLists 
                <span class="caret"></span>
              </a>
            <ul class="dropdown-menu">
              <li><%= link_to 'Tens 2013',  tens2013_path %></li>
              <li><%= link_to 'Tens 2012',  tens2012_path %></li>
            </ul>  
          <li>    
            <%= link_to 'theReviewers',  reviewers_path, class: "header_text" %>
          </li>
          <li>    
            <%= link_to 'theComments',  comments_board_path %>
          </li>
          <li>    
            <%= link_to 'theStats',  stats_path %>
          </li> 
          <li><%= link_to 'theBlog',  blog_path %></li>
        </ul>  
          <ul class="nav navbar-nav navbar-right">
            <% if user_signed_in? %>
              <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown"> theMenu 
                  <span class="caret"></span>
                </a>
            <ul class="dropdown-menu">
              <li class="dropdown-toggle"><%= link_to 'Add +',  new_pin_path %></li>
              <li><%= link_to 'Edit Profile',  edit_user_registration_path %></li>
              <li><%= link_to 'Logout',  destroy_user_session_path, method: :delete %></li>
            </ul>  
            <% else %>
              <li><%= link_to 'Login',  new_user_session_path %></li>
            <% end %>  
          </ul>       
      </div>
    </div>
  </div>  
</nav>

这是我的application.js:

//= require jquery
//= require jquery_ujs
//= require jquery.masonry.min.js
//= require twitter/bootstrap

0 个答案:

没有答案