如何使用rails - 资源管道提供静态链接的.swf flash文件?使用mongoid

时间:2012-12-08 09:39:04

标签: ruby-on-rails mongoid flash asset-pipeline

方案

rails应用程序正在运行mongoid。对于以下模型中的每个实例,都有一个需要为.swf flash文件的项目组合字段。

 class Person
    include Mongoid::Document
    field :name, type: String
    field :skill, type: String
    field :portfolio, type: String # portfolio will be a flash .swf and needs to have a static live url on the server
 end

如何安排模型在服务器上本地保存文件,以便每个文件都有唯一的URL。 (不使用载波或回形针)

我应该使用资产管道吗?因为我将在本地保存这些文件。

我正在寻找的最终结果是这样的:

http://www.persons.com/persons/portfolios/some_unique_id

一个人只能有一个投资组合,因此,不使用参考。

0 个答案:

没有答案