2023-11-08 17:38:38 +00:00

29 lines
1.0 KiB
Plaintext

%h1 Listing profiles
%div{style: "align-self: start; padding-left: .8em;"}
- if policy(Profile).new?
= link_to '+ New Profile', new_profile_path
- else
= link_to 'Sign In', new_user_session_path
to create a new Profile
- @profiles.each do |profile|
= link_to profile do
.profile
%h1= profile.name
%span= profile.summary
-# = link_to "", "#"
.social-links
- profile.social_links.each do |social_link|
- if policy(social_link).destroy?
%span.controls
= link_to '📝', edit_social_link_path(social_link)
= link_to '❌', social_link, method: :delete, data: { confirm: 'Are you sure?' }
= social_link.to_icon.html_safe
- if policy(profile).edit?
%br= link_to '+ Add Social Link', new_social_link_path(profile_id: profile.id)
%p= profile.about
- if policy(profile).destroy?
= link_to 'Edit', edit_profile_path(profile)
= link_to 'Delete', profile, method: :delete, data: { confirm: 'Are you sure?' }