我对 Rails 很陌生,我已经在整个网络上寻找这个问题的答案。我尝试了许多不同的解决方案,但似乎都没有奏效。这就是我所拥有的。
在我的标题中:
<header class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<%= link_to "Example App", root_path, id: "logo" %>
<nav>
<ul class="nav pull-right">
<li> <%= link_to "Home", root_path %> </li>
<li> <%= link_to "Help", help_path %> </li>
<% if signed_in? %>
<li> <%= link_to "Users", '#' %> </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", '#' %> </li>
<li class="divider"></li>
<li>
<%= link_to "Sign out", signout_path, method: "delete" %>
</li>
</ul>
</li>
<% else %>
<li> <%= link_to "Sign in", signin_path %> </li>
<% end %>
</ul>
</nav>
</div>
</div>
</header>
My applications.js File:
//= require jquery
//= require jquery_ujs
//= require bootstrap
//= require_tree .