整个文件如下
<header class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<%= link_to "CIMS知识共享平台", root_path, id: "logo" %>
<nav>
<ul class="nav pull-right">
<% if signed_in? %>
<% if current_user.admin? %>
<li><%= link_to "管理员", admin_path %></li>
<% end %>
<li><%= link_to "用户圈", users_path %></li>
<li><%= link_to "发布文章", articles_path %></li>
<li id="fat-menu" class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
账户 <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><%= link_to "资料显示", current_user %></li>
<li><%= link_to "设置更新", edit_user_path(current_user) %></li>
<li class="divider"></li>
<li>
<%= link_to "退出", signout_path, method: "delete" %>
</li>
</ul>
</li>
<% else %>
<li><%= link_to "用户登陆", signin_path%></li>
<% end %>
</ul>
</nav>
</div>
</div>
</header>
使用 bootstrap 的下拉框,代码中下拉框部分是:
<li id="fat-menu" class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
账户 <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><%= link_to "资料显示", current_user %></li>
<li><%= link_to "设置更新", edit_user_path(current_user) %></li>
<li class="divider"></li>
<li>
<%= link_to "退出", signout_path, method: "delete" %>
</li>
</ul>
</li>
出现的问题是下拉框失效,但是同样的代码在 ruby on rails tutorial 中是可以实现的,向各位前辈请教?