1

From time to time, we held special events on our site (e.g. discounts or lottery draw). These events each will have a special page (or pages) with very distinct styles/javascripts/images.

These one-time-use pages will be removed once the events are over. Managing the files can get messy as we have to name stylesheets, change the image path inside stylesheets, create corresponding image controller folders, etc.

How to better manage all resources related to the event, so it can be mounted on the main site easily? I have looked into Rails engine, but it seems to require each event to be as one gem, which seems overly complicated for me.

4

1 回答 1

0

不久前我们遇到过类似的情况(对于用户帐户而不是事件),我们尝试在资产文件结构中管理 css 和图像,每个集合都包含在一个根据它们所在帐户的 id 命名的目录中。这工作得很好,但意味着为样式的任何更改部署整个应用程序,这些资产上的更改请求的数量和性质很小,至少可以说这个过程很乏味。

所以我们已经切换到数据库驱动模型。自定义样式包含在客户记录的文本字段中。图像托管在 AWS S3 上,样式表通过绝对 URL 引用它们。我们设想有一天使用 CarrierWave 将图像附加到记录中,但现在手动管理图像就足够了。

于 2013-03-18T11:05:42.877 回答