From 69100b30146aa062e999e7e3c5b5e703ffb97f60 Mon Sep 17 00:00:00 2001 From: Ben <95949082+kasugaijin@users.noreply.github.com> Date: Sat, 21 Oct 2023 15:09:12 -0700 Subject: [PATCH] remove file upload and rendering of images from form as we are handling these in the Files tab of Pet show page. Also convert link_to to button_to as the former was not working (#294) --- app/views/organizations/pets/_form.html.erb | 31 +-------------------- app/views/organizations/pets/show.html.erb | 12 ++++---- 2 files changed, 7 insertions(+), 36 deletions(-) diff --git a/app/views/organizations/pets/_form.html.erb b/app/views/organizations/pets/_form.html.erb index d8292a0ee..67c04ab8b 100644 --- a/app/views/organizations/pets/_form.html.erb +++ b/app/views/organizations/pets/_form.html.erb @@ -11,7 +11,7 @@
- + <%= form.date_select :birth_date, start_year: Date.today.year - 20, end_year: Date.today.year %> @@ -71,35 +71,6 @@
-
- <%= form.file_field :append_images, multiple: true, - class: "custom-attachments", - label: 'Attach images' %> - - <% pet.errors.full_messages_for(:images).each do |message| %> - - <% end %> -
- -
- <% if pet.images.attached? %> -

<%= t('.uploaded_images') %>

-
- <% pet.images.each do |image| %> - <% if image.created_at %> -
- <%= image_tag image, class: 'uploaded-image rounded mt-2 mb-2' %> - <%= link_to t('general.delete'), - purge_attachment_path(image), - data: { turbo_method: "delete" }, - class: 'delete-button' %> -
- <% end %> - <% end %> -
- <% end %> -
- <%= form.submit t('general.save'), class: 'btn btn-outline-dark mb-3 mt-4' %> <% end %> diff --git a/app/views/organizations/pets/show.html.erb b/app/views/organizations/pets/show.html.erb index a19eaf21d..450337b3e 100644 --- a/app/views/organizations/pets/show.html.erb +++ b/app/views/organizations/pets/show.html.erb @@ -116,12 +116,12 @@ - <%= link_to t('general.delete'), pet_path(@pet), class: 'btn btn-outline-danger mt-2', - data: - { - turbo_method: :delete, - turbo_confirm: t('organization_pets.show.are_you_sure_delete') - } %> + <%= + button_to t('general.delete'), + pet_path(@pet), method: :delete, + class: 'btn btn-outline-danger mt-2', + data: { turbo_confirm: t('.are_you_sure_delete') } + %>