Skip to content

Commit e70e0aa

Browse files
committed
Merge pull request #211 from alegscogs/script_tag_options
Accept an options parameter in Jammit::Helper#include_javascripts
2 parents 21f60a9 + 8d9cdab commit e70e0aa

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

lib/jammit/helper.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ def include_stylesheets(*packages)
2525
# Writes out the URL to the bundled and compressed javascript package,
2626
# except in development, where it references the individual scripts.
2727
def include_javascripts(*packages)
28+
options = packages.extract_options!
2829
html_safe packages.map {|pack|
2930
should_package? ? Jammit.asset_url(pack, :js) : Jammit.packager.individual_urls(pack.to_sym, :js)
3031
}.flatten.map {|pack|
31-
javascript_include_tag pack
32+
javascript_include_tag pack, options
3233
}.join("\n")
3334
end
3435

@@ -72,8 +73,8 @@ def embedded_image_stylesheets(packages, options)
7273
# Generate the stylesheet tags for a batch of packages, with options, by
7374
# yielding each package to a block.
7475
def tags_with_options(packages, options)
75-
packages.dup.map {|package|
76-
yield package
76+
packages.dup.map {|package|
77+
yield package
7778
}.flatten.map {|package|
7879
stylesheet_link_tag package, options
7980
}.join("\n")

0 commit comments

Comments
 (0)