Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 3.1 asset pipeline vendor/assets folder organization

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?

Thanks!

like image 339
J Graham Avatar asked Jan 06 '12 20:01

J Graham


1 Answers

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

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

like image 190
Richard Hulse Avatar answered Oct 09 '22 20:10

Richard Hulse