Added Profile route and nav

This commit is contained in:
2024-08-27 16:37:26 +02:00
parent 18c343f9fb
commit fe9dbcfff0
2 changed files with 6 additions and 0 deletions

View File

@@ -3,6 +3,11 @@
<% if user_signed_in? && (current_user.admin? || current_user.operator?) %>
<nav>
<ul class="flex justify-center space-x-2 font-semibold items-color">
<li class="relative">
<button class="px-4 py-2 cursor-default hover:text-hsrm-red border-b-4 <%= admin? && 'border-hsrm-red-light' %>">
<%= link_to "Profil", profile_path %>
</button>
</li>
<li class="relative">
<button class="px-4 py-2 cursor-default hover:text-hsrm-red border-b-4 <%= admin? && 'border-hsrm-red-light' %>">
<%= link_to_if current_user.admin?, "Admin", admin_dashboard_path %>

View File

@@ -15,6 +15,7 @@ Rails.application.routes.draw do
patch "cancel"
end
end
resource :profile, only: [ :show, :edit, :destroy ]
namespace :admin do
resource :users
resource :jobs