i have logo file in public folder rails.
i want to send the file, as url, so the front end can access the url to view the file.
How to send the file as url to the file in my response json?
i have serializer like this
class PostOwnerSerializer
include FastJsonapi::ObjectSerializer
attribute :avatar do |u|
simple_logo = File.open(File.join(Rails.root, 'public', 'simple.png'))
# Rails.application.routes.url_helpers.rails_blob_url(simple_logo , only_path: true)
end
end
i try for using rails url helpers but it error
NoMethodError:
undefined method `signed_id' for #<File:/ahoyhu/public/simple.png>