Skip to content

Instantly share code, notes, and snippets.


shankardevy/app_nav.html.eex Secret

Created Jul 8, 2017
What would you like to do?
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#primary-nav">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<a class="navbar-brand" href="/">
<img src="/images/logo.png"/> Mango
<div class="collapse navbar-collapse" id="primary-nav">
<ul class="nav navbar-nav">
<li><%= link "Fruits", to: category_path(@conn, :show, "fruits") %></li>
<li><%= link "Vegetables", to: category_path(@conn, :show, "vegetables") %></li>
<!-- add code from here -->
<ul class="nav navbar-nav navbar-right">
<%= if @customer do %>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><%= %><span class="caret"></span></a>
<ul class="dropdown-menu">
<li><%= link "Log Out", to: "/logout" %></li>
<% else %>
<li><%= link "Register", to: registration_path(@conn, :new), class: "nav-link" %></li>
<li><%= link "Sign in", to: session_path(@conn, :new), class: "nav-link" %></li>
<% end %>
<!-- Upto here -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment