Module: ApplicationHelper

Defined in:
lib/templates/app/helpers/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#collect_js(*patterns) ⇒ Object



2
3
4
5
6
7
8
9
10
# File 'lib/templates/app/helpers/application_helper.rb', line 2

def collect_js(*patterns)
  options = patterns.extract_options!.stringify_keys
  recursion = !options["without_recursion"] # with recursion by default
  patterns.collect do |pattern|
    scripts = collect_asset_files(File.join(RAILS_ROOT, 'public', 'javascripts'), pattern + '.js')
    scripts = scripts + collect_asset_files(File.join(RAILS_ROOT, 'public', 'javascripts'), pattern, '**', '*.js') if recursion
    scripts
  end
end