Add sign in logic to link display in layout (needs helper)
This commit is contained in:
parent
586e797047
commit
dd5c725715
1 changed files with 9 additions and 3 deletions
|
@ -44,14 +44,20 @@
|
||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
</a>
|
</a>
|
||||||
<a class="brand" href="#">MsuCourseAlerter</a>
|
<a class="brand" href="/">MsuCourseAlerter</a>
|
||||||
<div class="container-fluid nav-collapse">
|
<div class="container-fluid nav-collapse">
|
||||||
<ul class="nav">
|
<ul class="nav">
|
||||||
|
<% if user_signed_in? %>
|
||||||
<li><%= link_to "Alerts", alerts_path %></li>
|
<li><%= link_to "Alerts", alerts_path %></li>
|
||||||
<li><%= link_to "Sign in", new_user_session_path,
|
|
||||||
:method => :get %></li>
|
|
||||||
<li><%= link_to "Sign out", destroy_user_session_path,
|
<li><%= link_to "Sign out", destroy_user_session_path,
|
||||||
:method => :delete %></li>
|
:method => :delete %></li>
|
||||||
|
<% else %>
|
||||||
|
<li><%= link_to "Sign in", new_user_session_path,
|
||||||
|
:method => :get %></li>
|
||||||
|
<li><%= link_to "Register", new_user_registration_path,
|
||||||
|
:method => :get %></li>
|
||||||
|
|
||||||
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
</div><!--/.nav-collapse -->
|
</div><!--/.nav-collapse -->
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue