当我在本地测试我的网站时,它工作正常,但是一旦我推送到 heroku,下拉菜单就不起作用。
我的 application.js 文件包含以下内容:
//= require bootstrap
//= require jquery
//= require jquery_ujs
//= require_tree .
我的 application.html.erb 文件包含这个
<!DOCTYPE html>
<html>
<head>
<title> <%= full_title(yield(:title)) %> </title>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
<%= render 'layouts/shim' %>
</head>
<body>
<%= render 'layouts/header' %>
<div class="container">
<%= yield %>
</div>
</body>
</html>
我的标题部分是下拉菜单所在的位置,包含这个
<header class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<ul class="nav pull-left">
<li>
<%= link_to image_tag("WML_header2.png", :alt => 'Wheres My Lan'), home_path%>
</li>
</ul>
<nav>
<ul class="nav pull-right">
</br>
<li><%= link_to "Heat Map", heatMap_path %></li>
<% if signed_in? %>
<li><%= link_to "New Update", new_message_path %></li>
<li id="fat-menu" class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
View <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><%= link_to "Users", users_path %></li>
<li><%= link_to "Reports", reports_path %></li>
<li><%= link_to "Statistics", stats_path %></li>
</ul>
</li>
<li id="fat-menu" class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Account <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><%= link_to "Profile", current_user %></li>
<li><%= link_to "Settings", settings_path %></li>
<li class="divider"></li>
<li>
<%= link_to "Sign out", signout_path, method: "delete" %>
</li>
</ul>
</li>
<% else %>
<li><%= link_to "Admin sign in", signin_path %></li>
<% end %>
<li><%= link_to "About", about_path %></li>
<li><%= link_to "Contact", contact_path %></li>
</ul>
</nav>
</div>
</div>
</header>