I have my assets folder structure like this
assets
javascripts
products
--product.js
--productValidate.js
store
--store.js
This is what I am working on now to bridge the gap between Rails 3.1 assets pipeline and Jammit.
I have not provided any documentation as it I consider it under development yet. But this is what it basically should allow you to do:
# config/initializers/pakunok.rb
# Define the dependencies between Rails assets:
require 'pakunok'
Pakunok::Pakunok.current.configure do
asset('products/product.js').needs('products/productValidate.js')
end
And then, in your layout, you only need to do a single include. All the dependent files will be included automatically:
# app/views/layouts/application.html.erb
<%= include_javascripts %>
Please see the specs to learn what the gem can do. Note: it is still under development and the gem itself will be split into multiple ones later.
For any particular use-cases that you want to be supported, please submit issues and I promise to work hard to implement those when I'll have time :)