Skip to content

Commit c544f22

Browse files
committed
use asset pipeline for other image fetches
1 parent 4e9f20a commit c544f22

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/models/page_collections/page_collection.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def random_public_image
5151
end
5252

5353
# If all else fails, fall back on default header
54-
"card-headers/#{self.class.name.downcase.pluralize}.jpg"
54+
ActionController::Base.helpers.asset_path("card-headers/#{self.class.name.downcase.pluralize}.jpg")
5555
end
5656

5757
def first_public_image

app/models/page_types/content_page.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class ContentPage < ApplicationRecord
1010
self.authorizer_name = 'ContentPageAuthorizer'
1111

1212
def random_image_including_private(format: :small)
13-
ImageUpload.where(content_type: self.page_type, content_id: self.id).sample.try(:src, format) || "/assets/card-headers/#{self.page_type.downcase.pluralize}.jpg"
13+
ImageUpload.where(content_type: self.page_type, content_id: self.id).sample.try(:src, format) || ActionController::Base.helpers.asset_path("card-headers/#{self.page_type.downcase.pluralize}.jpg")
1414
end
1515

1616
def icon

0 commit comments

Comments
 (0)