From 31ab405253ff4df563480c8a0ff20540fcf14772 Mon Sep 17 00:00:00 2001 From: Antti Hukkanen Date: Thu, 7 Mar 2024 03:34:28 +0200 Subject: [PATCH] Switch to asset URLs instead of paths --- app/cells/decidim/accountability/result_m_cell.rb | 4 ++-- .../decidim/accountability/results/_show_parent.html.erb | 2 +- app/views/decidim/accountability/results/show.html.erb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/cells/decidim/accountability/result_m_cell.rb b/app/cells/decidim/accountability/result_m_cell.rb index c1430a0..19a07c9 100644 --- a/app/cells/decidim/accountability/result_m_cell.rb +++ b/app/cells/decidim/accountability/result_m_cell.rb @@ -78,7 +78,7 @@ def has_category? def resource_image_path return unless has_image? - model.attached_uploader(:list_image).path + model.attached_uploader(:list_image).url end def status_label @@ -214,7 +214,7 @@ def category_icon full_category << translated_attribute(cat.name) content_tag(:span, class: "card__category__icon", "aria-hidden": true) do - image_tag(cat.attached_uploader(:category_icon).path, alt: full_category.join(" - ")) + image_tag(cat.attached_uploader(:category_icon).url, alt: full_category.join(" - ")) end end diff --git a/app/views/decidim/accountability/results/_show_parent.html.erb b/app/views/decidim/accountability/results/_show_parent.html.erb index c674bf6..9498151 100644 --- a/app/views/decidim/accountability/results/_show_parent.html.erb +++ b/app/views/decidim/accountability/results/_show_parent.html.erb @@ -17,7 +17,7 @@ root_result = root_result.parent while root_result.parent

<%= translated_attribute result.title %>

<% if result.main_image && result.main_image.attached? %> - <%= image_tag result.attached_uploader(:main_image).path, alt: translated_attribute(result.title), class: "resource__image" %> + <%= image_tag result.attached_uploader(:main_image).url, alt: translated_attribute(result.title), class: "resource__image" %> <% end %> diff --git a/app/views/decidim/accountability/results/show.html.erb b/app/views/decidim/accountability/results/show.html.erb index a5fbb32..9026da6 100644 --- a/app/views/decidim/accountability/results/show.html.erb +++ b/app/views/decidim/accountability/results/show.html.erb @@ -1,6 +1,6 @@ <% image = nil -image = result.attached_uploader(:list_image).path if result.list_image && result.list_image.attached? +image = result.attached_uploader(:list_image).url if result.list_image && result.list_image.attached? add_decidim_meta_tags({ description: translated_attribute(result.description),