[英]Upload and download of files using PaperClip
I have a question that I do not really not how to answer .. I would like my users to be able to upload and download midi files from the website. 我有一个问题,我真的不是怎么回答..我希望我的用户能够从网站上载和下载Midi文件。
For the upload no problem I used paperClip gem. 对于上传没有问题,我使用了paperClip gem。 My issue is for the download link I dont know how to do it ... I tried a few things but the results give me just an url type ..
我的问题是下载链接,我不知道该怎么做...我尝试了一些操作,但结果只是URL类型。
Could you help me ? 你可以帮帮我吗 ?
Thx you so much for your help! 非常感谢您的帮助!
Raphael 拉斐尔
Solution is as simple as trying this: 解决方案就像尝试此操作一样简单:
<%= link_to @midi.middiz.filename, @midi.middiz.url %>
It will create an anchor tag pointing to the file to be downloaded. 它将创建一个指向要下载文件的锚标记。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.