Skip to content

Instantly share code, notes, and snippets.

@rwehresmann
Last active August 25, 2019 14:19
Show Gist options
  • Select an option

  • Save rwehresmann/ae4d028f0677ccf849c77aaec619570b to your computer and use it in GitHub Desktop.

Select an option

Save rwehresmann/ae4d028f0677ccf849c77aaec619570b to your computer and use it in GitHub Desktop.
<% if current_user %>
<% if current_admin_user.present? && current_admin_user != current_user %>
<h1><%= current_admin_user.email %> is logged in as <%= current_user.email %>.</h1>
<% else %>
<h1><%= current_user.email %> is logged in.</h1>
<% end %>
<ul>
<li><%= link_to 'Admin', admin_root_path %></li>
<li><%= link_to 'Log out', auth_logout_path, method: :post %></li>
</ul>
<% else %>
<h1>None user is authenticated. <%= link_to 'Log in', authentication_path %></h1>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment