Skip to content

Commit

Permalink
Implement a simple navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
pushkar1995 committed Dec 6, 2023
1 parent be6d503 commit ed809ff
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 2 additions & 0 deletions app/controllers/splash_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
class SplashController < ApplicationController
skip_before_action :authenticate_user!

def index
end
end
12 changes: 11 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@
</head>

<body>
<% if user_signed_in? %>
<nav>
<p>Hello <%= current_user.name %></p>
<%= link_to "Sign out", destroy_user_session_path, data: { turbo_method: :delete } %>
</nav>
<% end %>

<p class="notice"><%= notice %></p>
<p class="alert"><%= alert %></p>

<%= yield %>
</body>
</html>
</html>
7 changes: 5 additions & 2 deletions app/views/splash/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
<h1>Splash#index</h1>
<p>Find me in app/views/splash/index.html.erb</p>
<div>
<h1>Budget App</h1>
<%= link_to "Sign in", new_user_session_path %>
<%= link_to "Sign up", new_user_registration_path %>
</div>

0 comments on commit ed809ff

Please sign in to comment.