mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
use asset pipeline for other image fetches
This commit is contained in:
parent
4e9f20a1a8
commit
c544f2290b
@ -51,7 +51,7 @@ class PageCollection < ApplicationRecord
|
||||
end
|
||||
|
||||
# If all else fails, fall back on default header
|
||||
"card-headers/#{self.class.name.downcase.pluralize}.jpg"
|
||||
ActionController::Base.helpers.asset_path("card-headers/#{self.class.name.downcase.pluralize}.jpg")
|
||||
end
|
||||
|
||||
def first_public_image
|
||||
|
||||
@ -10,7 +10,7 @@ class ContentPage < ApplicationRecord
|
||||
self.authorizer_name = 'ContentPageAuthorizer'
|
||||
|
||||
def random_image_including_private(format: :small)
|
||||
ImageUpload.where(content_type: self.page_type, content_id: self.id).sample.try(:src, format) || "/assets/card-headers/#{self.page_type.downcase.pluralize}.jpg"
|
||||
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")
|
||||
end
|
||||
|
||||
def icon
|
||||
|
||||
Loading…
Reference in New Issue
Block a user