简体   繁体   English

Rails-在没有模型的情况下使用回形针吗?

[英]Rails - Using Paperclip with no model?

is it possible to use Paperclip without a model? 没有模型就可以使用回形针吗? I just need the ability for an admin user to upload a pdf to a specific dir and that pdf can be overwritten when a more current pdf is uploaded. 我只需要管理员用户能够将pdf上传到特定目录,并且当上传更多最新的pdf时可以覆盖pdf。

I'm on rails 2.3.5. 我在2.3.5上。

Thanks. 谢谢。

What's the problem with introducting a PDF model to use? 引入要使用的PDF模型有什么问题? It's easy enough. 很简单。

If you don't want that model, then don't use paperclip and save the attachments yourself, they come in as instances of TempFile . 如果您不希望使用该模型,则不要使用回形针自己保存附件,它们会作为TempFile实例TempFile

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM