Make require_tree work with lib assets #2981

Closed
ansman opened this Issue Sep 11, 2011 · 5 comments

Projects

None yet

4 participants

@ansman

Currently require_tree only works with relative paths so if you want to include all javascript in your lib dir (which you most likely want) from your application.js you need to either include them one by one or do require_tree ../../../lib/javascripts which is all kinds of wrong.

Maybe it should be called require_tree, I don't know. Just want some way of including trees from different directories.

@dmathieu

This is highly probably a sprockets issue, not rails.

@guilleiguaran
Ruby on Rails member

I think this can be solved with:

config.assets.paths << "#{Rails.root}/lib/javascripts"
@ansman

No, first of it's root/lib/assets/javascripts and secondly it's already in the assets path.

The problem is that require_tree only accepts paths relative to its own directory.

@ansman ansman closed this Sep 13, 2011
@ansman ansman reopened this Sep 13, 2011
@arunagw
Ruby on Rails member

Guys. Is this still a issue? Or this can be closed??

@guilleiguaran
Ruby on Rails member

I think this can be closed since there isn't nothing that we can do in Rails to fix this, as @dmathieu it should be supported in Sprockets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment