Rails 3.1资产管道供应商/资产文件夹组织 [英] Rails 3.1 asset pipeline vendor/assets folder organization

查看:132
本文介绍了Rails 3.1资产管道供应商/资产文件夹组织的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Rails 3.1站点中使用 jQuery工具可滚动库,并将各种资产放置在vendor/assets文件夹,效果很好.

I'm using the jQuery Tools scrollable library in my Rails 3.1 site with the various assets placed in the vendor/assets folder and it works great.

我的问题是关于在卖方/资产下组织各种文件的最佳方法.建议使用什么方法来组织供应商/资产子文件夹?目前,我有这样的结构:

My question is regarding the best way to organize the various files under vendor/assets. What is the recommended way to organize vendor/assets subfolders? Currently I have this structure:

vendor/assets/
 |-- images/
 |    |-- scrollable/
 |          <various button/gradient images>
 |-- javascripts/
 |    |-- scrollable/
 |          jquery.tools.min.js
 |-- stylesheets/
 |    |-- scrollable/
 |          scrollable-buttons.css
 |          scrollable-horizontal.css

这是一个相当干燥的操作.我认为所有可滚动"项都应位于一个文件夹下.

This is a fairly un-DRY what to do this. I feel that all of the 'scrollable' items should be under one folder.

在无需操纵资产管道加载路径的情况下,推荐的方法是什么?

What is the recommended way to do this without having to manipulate the asset pipeline load paths?

谢谢!

推荐答案

您可以通过这种方式组织它们,这样做会更好一些,因为它将与插件相关的内容保留在一个目录中:

You could organise them this way, which is slightly better in that it keeps stuff related to the plugin in one directory:

vendor/assets/scrollable
 |-- images/
 |    |-- <various button/gradient images>
 |-- javascripts/
 |    |-- jquery.tools.min.js
 |-- stylesheets/
 |    |-- scrollable-buttons.css
 |        scrollable-horizontal.css

我很确定这可以作为rails遍历Assets/下的所有目录.

I am pretty sure this will work as rails globs all directories under assets/.

这篇关于Rails 3.1资产管道供应商/资产文件夹组织的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆