Skip to content

Commit

Permalink
Switch to asset URLs instead of paths
Browse files Browse the repository at this point in the history
  • Loading branch information
ahukkanen committed Mar 7, 2024
1 parent b011921 commit 31ab405
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/cells/decidim/accountability/result_m_cell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ root_result = root_result.parent while root_result.parent
<h1><%= translated_attribute result.title %></h1>

<% 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 %>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/decidim/accountability/results/show.html.erb
Original file line number Diff line number Diff line change
@@ -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),
Expand Down

0 comments on commit 31ab405

Please sign in to comment.