Fixed profile selected state in navbar
This commit is contained in:
@@ -25,4 +25,8 @@ module ApplicationHelper
|
||||
def admin?
|
||||
controller.class.name.split("::").first=="Admin"
|
||||
end
|
||||
|
||||
def profile?
|
||||
controller.class.name.split("::").first=="Profile"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<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' %>">
|
||||
<button class="px-4 py-2 cursor-default hover:text-hsrm-red border-b-4 <%= profile? && 'border-hsrm-red-light' %>">
|
||||
<%= link_to "Profil", profile_path %>
|
||||
</button>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user