mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-27 19:23:59 -04:00
Fix: Only show 'add a bio' link on own profile
The 'add a bio' link on the member profile page was previously shown based on the `can? :edit, @member` ability check. This caused an issue for admins, who could see the link on other users' profiles, but the link would incorrectly lead to their own settings page. This change modifies the condition to be `member_signed_in? && current_member == @member`. This ensures the link is only displayed when a logged-in user is viewing their own profile, which is the correct and intended behavior.
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
%a{href: "#content"}
|
||||
Skip to main content
|
||||
- if @member.bio.blank?
|
||||
- if can? :edit, @member
|
||||
- if member_signed_in? && current_member == @member
|
||||
= link_to "Add a bio to complete your profile.", edit_member_registration_path
|
||||
- else
|
||||
#{@member.login_name} hasn't written a bio yet.
|
||||
|
||||
Reference in New Issue
Block a user