Flowdock
method

expand_javascript_sources

Importance_0
v2.0.0 - Show latest stable - 0 notes - Class: ActionView::Helpers::AssetTagHelper
expand_javascript_sources(sources) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File actionpack/lib/action_view/helpers/asset_tag_helper.rb, line 495
        def expand_javascript_sources(sources)          
          case
          when sources.include?(:all)
            all_javascript_files = Dir[File.join(JAVASCRIPTS_DIR, '*.js')].collect { |file| File.basename(file).split(".", 0).first }.sort
            sources = ((@@javascript_default_sources.dup & all_javascript_files) + all_javascript_files).uniq

          when sources.include?(:defaults)
            sources = sources[0..(sources.index(:defaults))] + 
              @@javascript_default_sources.dup + 
              sources[(sources.index(:defaults) + 1)..sources.length]

            sources.delete(:defaults)
            sources << "application" if file_exist?(File.join(JAVASCRIPTS_DIR, "application.js"))
          end

          sources
        end
Register or log in to add new notes.