Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Asset include helpers should consider subdirectories when used with :all

#480

(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.

Reported by Damian Janowski · July 4th, 2008 @ 09:22 PM

State: resolved
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Emilio Tagua
    Emilio Tagua
    • Tag set 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.

    June 25th, 2008 @ 11:29 PM

  2. Pratik
    Pratik
    • State changed from new to incomplete
    • Assigned user set 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.

    June 27th, 2008 @ 01:49 PM

  3. José Valim
    José Valim

    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.

    June 30th, 2008 @ 11:37 PM

  4. Clemens Kofler
    Clemens Kofler

    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.

    July 1st, 2008 @ 12:10 AM

  5. Pratik
    Pratik

    I agree that this has to be an opt-in feature ( what José said ).

    July 4th, 2008 @ 01:46 AM

  6. Damian Janowski
    Damian Janowski

    OK, I'm submitting a new patch with the opt-in alternative:

    javascript_include_tag :all, :recursive => true
    stylesheet_link_tag :all, :recursive => true
    

    Tests and docs updated.

    July 4th, 2008 @ 09:19 PM

  7. José Valim
  8. David Dollar
    David Dollar
    • 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

    July 6th, 2008 @ 06:54 AM

  9. Clemens Kofler
    Clemens Kofler

    Now that it's backwards compatible, I like it too.

    +1

    July 6th, 2008 @ 12:57 PM

  10. Pratik
    Pratik
    • State changed from incomplete to open

    July 6th, 2008 @ 08:33 PM

  11. Repository
    Repository
    • 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

    http://github.com/rails/rails/co...

    July 8th, 2008 @ 02:09 PM