Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在不使用表单的情况下将图像文件保存到载波中的上传器类?
我想改用系统中已有的现有图像。
假设它是一个名为 image 的模型,并且上传器安装为载波:
image.carrierwave.store!(File.new("/tmp/image.png")) image.write_carrierwave_identifier image.save
店铺!接受 File、IOString 或 Tempfile。