Asset include helpers should consider subdirectories when used with :all
Reported by Damian Janowski | June 25th, 2008 @ 02:19 AM
(New title is Add a option to javascript_include_tag and stylesheet_link_tag to be used together with )
This means that if you have something like:
public/javascripts/super_calendar/calendar.js
public/stylesheets/super_calendar/calendar.css
Those will be included when calling
javascript_include_tag :all, :recursive => true
stylesheet_link_tag :all, :recursive => true
Tests and docs updated.
Comments and changes to this ticket
-
miloops October 23rd, 2008 @ 04:28 PM
- → Tag changed from to actionpack patch tested
+1
I think all should mean ALL of them.
But it would be helpful to have an option to specify that it should not include subdirectories.
-
Pratik June 27th, 2008 @ 01:49 PM
- → State changed from new to incomplete
- → Assigned user changed from to Pratik
1. Patch should cache the Dir[File.join(dir, '**', "*.#{extension}")] output.
2. It'd be nice to drop an email to railscore mailing list :)
Thanks.
-

José Valim June 30th, 2008 @ 11:37 PM
Wouldn't be better if You explicitly declare it?
Like:
javascript_include_tag :all, :directories => true
stylesheet_link_tag :all, :directories => true
For example, all my javascripts are packed (http://dean.edwards.name/packer/) and I have a subfolder /public/javascript/source. It would be a disaster if it was merged and sent to everyone in production.
-
Clemens Kofler July 1st, 2008 @ 12:10 AM
I'd have to agree with José. Making it a default could lead to some really wicked behavior if you're using 3rd party stuff or, e.g., if you create some JavaScript dynamically using a JavascriptsController and/or SASS.
-
-
Damian Janowski July 4th, 2008 @ 09:19 PM
OK, I'm submitting a new patch with the opt-in alternative:
javascript_include_tag :all, :recursive => true stylesheet_link_tag :all, :recursive => trueTests and docs updated.
-

-

David Dollar July 6th, 2008 @ 06:54 AM
- → Tag changed from actionpack patch tested to actionpack patch tested verified
All tests pass and I'd like to see this one make it in.
+1
-
-
Pratik July 6th, 2008 @ 08:33 PM
- → State changed from incomplete to open
-

Repository July 8th, 2008 @ 02:09 PM
- → State changed from open to resolved
(from [91320f2a809d3a59efabd9f839fe9b879f4a9b29]) Add :recursive option to javascript_include_tag and stylesheet_link_tag to be used along with :all. [#480 state:resolved]
Signed-off-by: Pratik Naik
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
Source available from github
Repository is at http://github.com/rails/rails
Check out the development master (Edge Rails):
git clone git://github.com/rails/rails.git
Creating or reviewing a patch
See the contributor guide.
Creating a feature request
Please don't. If you want a new feature in Rails, you'll have to pull up your sleeves and get busy yourself. Or convince someone else to do it. See the contributor guide on how to get going. But posting them here is just going to lead to ticket root.
Creating a bug report
When creating a bug report, be sure to include as much relevant information as possible. Post the code sample that causes the problem. Preferably, alter the unit tests and show through either changed or added tests how the expected behavior is not occuring.
Security vulnerabilities should be reported via an email to security@rubyonrails.org, do not use trac for reporting security vulnerabilities. All content in trac is publicly available as soon as it is posted.
Then don't get your hopes up. Unless you have a "Code Red, Mission Critical, The World is Coming to an End" kinda bug, you're creating this ticket in the hope that others with the same problem will be able to collaborate with you on solving it. Do not expect that the ticket automatically will see any activity or that others will jump to fix it. Creating a ticket like this is mostly to help yourself start on the path of fixing the problem and for others to sign on to with a "I'm having this problem too"..
