[英]how to use contents of <ActionDispatch::Http::UploadedFile:0x007f91fc5c88d0> in Rails?
I've uploaded and encrypted two images to my app, and now I need to use them in an img_tag
.我已将两张图片上传并加密到我的应用程序中,现在我需要在
img_tag
中使用它们。 How can I retrieve the contents of this string and display them to the user?如何检索此字符串的内容并将其显示给用户?
Model.document_front: <ActionDispatch::Http::UploadedFile:0x007f91fc5c88d0>
You should be able to use the path
method: https://api.rubyonrails.org/v6.0.0/classes/ActionDispatch/Http/UploadedFile.html#method-i-path您应该可以使用
path
方法: https://api.rubyonrails.org/v6.0.0/classes/ActionDispatch/Http/UploadedFile.html#method-i-path
More information here:更多信息在这里:
https://www.reddit.com/r/rails/comments/8nqssd/actiondispatchhttpuploadedfile/ https://www.reddit.com/r/rails/comments/8nqssd/actiondispatchhttpuploadedfile/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.