Skip to content

Commit

Permalink
Set up the Application Layout with flash messages and Devise links
Browse files Browse the repository at this point in the history
  • Loading branch information
fortuity committed Aug 8, 2010
1 parent 8d0b067 commit f611d57
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 4 deletions.
9 changes: 9 additions & 0 deletions app/views/devise/menu/_login_items.html.erb
@@ -0,0 +1,9 @@
<% if user_signed_in? %>
<li>
<%= link_to('Logout', destroy_user_session_path) %>
</li>
<% else %>
<li>
<%= link_to('Login', new_user_session_path) %>
</li>
<% end %>
9 changes: 9 additions & 0 deletions app/views/devise/menu/_registration_items.html.erb
@@ -0,0 +1,9 @@
<% if user_signed_in? %>
<li>
<%= link_to('Edit account', edit_user_registration_path) %>
</li>
<% else %>
<li>
<%= link_to('Sign up', new_user_registration_path) %>
</li>
<% end %>
12 changes: 8 additions & 4 deletions app/views/layouts/application.html.erb
@@ -1,14 +1,18 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>Rails3SubdomainDevise</title> <title>Rails3-Subdomain-Devise</title>
<%= stylesheet_link_tag :all %> <%= stylesheet_link_tag :all %>
<%= javascript_include_tag :defaults %> <%= javascript_include_tag :defaults %>
<%= csrf_meta_tag %> <%= csrf_meta_tag %>
</head> </head>
<body> <body>

<ul class="hmenu">
<%= yield %> <%= render 'devise/menu/registration_items' %>

<%= render 'devise/menu/login_items' %>
</ul>
<p style="color: green"><%= notice %></p>
<p style="color: red"><%= alert %></p>
<%= yield %>
</body> </body>
</html> </html>
9 changes: 9 additions & 0 deletions public/stylesheets/application.css
@@ -0,0 +1,9 @@
ul.hmenu {
list-style: none;
margin: 0 0 2em;
padding: 0;
}

ul.hmenu li {
display: inline;
}

0 comments on commit f611d57

Please sign in to comment.