Skip to content

Instantly share code, notes, and snippets.

@eaglerockdude
Created April 22, 2015 01:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eaglerockdude/88d96e936d7f9efad9ec to your computer and use it in GitHub Desktop.
Save eaglerockdude/88d96e936d7f9efad9ec to your computer and use it in GitHub Desktop.
Rails Application Layout in HAML with navbar
!!! 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