show profiles good

This commit is contained in:
2023-01-22 11:36:35 +02:00
parent 080e02a1f3
commit a2fe816cc8
8 changed files with 66 additions and 44 deletions

View File

@ -1,10 +1,20 @@
-if event = profile.events.length >0
%div
=link_to profile.events.first.name , event_path(profile.events.first) , class: "underline"
= link_to edit_event_path(profile.events.first) do
%button.bg-cyan-200.mr-3.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400
Edit
-else
= link_to new_event_path(profile: profile.kind) do
= render "profile_card" , profile: profile
.flex.justify-between.mt-4
= link_to edit_profile_path(profile) do
%button.bg-cyan-200.mr-3.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400
Edit
= form_tag( profile_path(profile.id) , {method: :delete } ) do
%button.bg-red-200.mr-3.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400{type: :submit}
Delete Profile
-if event = profile.events.length >0
%div
=link_to profile.events.first.name , event_path(profile.events.first) , class: "underline"
= link_to edit_event_path(profile.events.first) do
%button.bg-cyan-200.mr-3.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400
New #{profile.Kind} Event
Edit
-else
= link_to new_event_path(profile: profile.kind) do
%button.bg-cyan-200.mr-3.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400
New #{profile.Kind} Event