This gist contains all the files relevant to the issue.
Created
December 2, 2021 00:56
-
-
Save lunaisnotaboy/c0d699d92c83c8af9aa3e9d8ee865398 to your computer and use it in GitHub Desktop.
This is for an issue I am having with the Ruby library Shrine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
class ImageUploader < Shrine | |
# There's actually stuff in here in the actual file, but most of it is sensitive. | |
# Rest assured, *nothing* in here is causing the problem. | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Just the image tag --> | |
<%= image_tag Topic.find(1).icon_url %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
# == Schema Information | |
# | |
# Table name: topics | |
# | |
# id :bigint not null, primary key | |
# description :text default(""), not null | |
# icon_data :text | |
# name :string default(""), not null | |
# created_at :datetime not null | |
# updated_at :datetime not null | |
# | |
class Topic < ApplicationRecord | |
include TopicIconUploader::Attachment(:icon) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
class TopicIconUploader < ImageUploader | |
# Again, since this code is sensitive, this is as much as I can give you. Apologies. | |
plugin :default_url | |
Attacher.default_url do |**_options| | |
'/images/icons/topic.png' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment