Slowly getting there.

This commit is contained in:
Jez Caudle 2022-07-17 18:01:19 +01:00
parent dc739cc189
commit 3cfbbc0c0b
2 changed files with 8 additions and 3 deletions

View File

@ -11,8 +11,6 @@
</head>
<body>
<header>
<% if notice %><p class="notice"><%= notice %></p><% end %>
<% if alert %><p class="alert"><%= alert %></p><% end %>
<nav>
<a href="/">Home</a>
<% if !user_signed_in? %>
@ -22,6 +20,9 @@
<% end %>
</nav>
</header>
<% if notice or alert %>
<% if notice %><p class="notice"><%= notice %></p><% end %><% if alert %><p class="alert"><%= alert %></p><% end %>
<% end %>
<%= yield %>
</body>
</html>

View File

@ -6,8 +6,12 @@ Rails.application.routes.draw do
resources :cafs
end
authenticated :user do
root to: 'home#index', as: :authenticated_root
end
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
# Defines the root path route ("/")
root "home#index"
root to: redirect('/users/sign_in')
end