Skip to content

Instantly share code, notes, and snippets.

@MyklClason
Last active August 4, 2017 03:15
Show Gist options
  • Save MyklClason/b393593d92986cf68aba5ddec44fc879 to your computer and use it in GitHub Desktop.
Save MyklClason/b393593d92986cf68aba5ddec44fc879 to your computer and use it in GitHub Desktop.
Bootstrap Rails Application.html layout with separated nav and footer
<%= menu_group do %>
<%= drop_down "Admin" do %>
<%= menu_item("All ", _path) %>
<% end %>
<% end %>
<%= nav_bar brand: ENV['APP_NAME'] do %>
<%= render partial: 'layouts/nav/left' %>
<%= render partial: 'layouts/nav/right' %>
<% end %>
<%= menu_group pull: :right do %>
<% if user_signed_in? %>
<%= menu_text current_user.role %>
<% if current_user.admin? %>
<%= menu_item("Users", users_path) %>
<% end %>
<%= menu_item "Sign out", destroy_user_session_path, method: :delete %>
<% else %>
<%= menu_item "Sign in", new_user_session_path %>
<% end %>
<% end %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><%= content_for?(:title) ? yield(:title) : ENV['APP_NAME'] %></title>
<%= csrf_meta_tags %>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js" type="text/javascript"></script>
<![endif]-->
</head>
<body>
<%= render partial: 'layouts/nav' %>
<div class="container">
<div class="row">
<div class="col-lg-12">
<div id='bootstrap_flash'>
<%= bootstrap_flash %>
<%= yield %>
</div>
</div>
</div><!--/row-->
<%= render partial: 'layouts/footer' %>
</div> <!-- /container -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment