Created
April 22, 2015 01:59
-
-
Save eaglerockdude/88d96e936d7f9efad9ec to your computer and use it in GitHub Desktop.
Rails Application Layout in HAML with navbar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!! 5 | |
%html | |
%head | |
%title Recipe App | |
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true | |
= javascript_include_tag 'application', 'data-turbolinks-track' => true | |
= csrf_meta_tags | |
%body | |
%nav.navbar.navbar-default | |
.container | |
.navbar-brand= link_to "Recipe Box", root_path | |
- if user_signed_in? | |
%ul.nav.navbar-nav.navbar-right | |
%li= link_to "New Recipe", new_recipe_path | |
%li= link_to "Sign Out", destroy_user_session_path, method: :delete | |
- else | |
%ul.nav.navbar-nav.navbar-right | |
%li= link_to "Sign Up", new_user_registration_path | |
%li= link_to "Sign In", new_user_session_path | |
.container | |
- flash.each do |name, msg| | |
= content_tag :div, msg, class: "alert" | |
= yield |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment