### Step 2:
在终端执行```rails g controller static_pages about help```。
### Step 3:
打开_navbar.html.erb,完整代码如下
```ruby _navbar.html.erb
<nav class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<a class="navbar-brand" href="/"> MONSOON </a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active">
<%= link_to("首页", products_path) %>
</li>
<li><%= link_to "分类浏览", "#" %></li>
<li><%= link_to "帮助", static_pages_help_path %></li>
<li><%= link_to "关于", static_pages_about_path %></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<%= link_to carts_path do %>
购物车 <i class="fa fa-shopping-cart"> </i> ( <%= current_cart.products.count %> )
<% end %>
</li>
<% if !current_user %>
<li><a href="#" data-toggle="modal" data-target="#signup-modal">注册</a></li>
<li><a href="#" data-toggle="modal" data-target="#login-modal">登入</a></li>
<% else %>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Hi!, <%= current_user.email %>
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<% if current_user.admin? %>
<li>
<%= link_to("后台管理", "admin_products_path" ) %>
</li>
<li role="separator" class="divider"></li>
<li>
<%= link_to("我的订单", account_orders_path ) %>
</li>
<li>
<a href="#">我的收获地址</a>
</li>
<li>
<a href="#">我的收藏</a>
</li>
<li role="separator" class="divider"></li>
<li>
<a href="#">个人信息</a>
</li>
<li role="separator" class="divider"></li>
<% end %>
<li> <%= link_to(content_tag(:i, '登出', class: 'fa fa-sign-out'), destroy_user_session_path, method: :delete) %> </li>
</ul>
</li>
<% end %>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>
<!-- 以下代码实现登入登出的弹窗效果 -->
<div class="modal fade" id="login-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog" role="document">
<div class="loginmodal-container">
<h2>Log in</h2>
<%= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<div class="form-inputs">
<%= f.input :email, required: false, autofocus: true %>
<%= f.input :password, required: false %>
<%= f.input :remember_me, as: :boolean if devise_mapping.rememberable? %>
</div>
<div class="form-actions">
<%= f.button :submit, "Log in" %>
</div>
<% end %>
</div>
</div>
</div>
<div class="modal fade" id="signup-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog">
<div class="loginmodal-container">
<h2>Sign up</h2>
<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<%= f.input :email, required: true, autofocus: true %>
<%= f.input :password, required: true, hint: ("#{@minimum_password_length} characters minimum" if @minimum_password_length) %>
<%= f.input :password_confirmation, required: true %>
</div>
<div class="form-actions">
<%= f.button :submit, "Sign up" %>
</div>
<% end %>
</div>
</div>
</div>