def js_include_tag(*scripts)
options = scripts.last.is_a?(Hash) ? scripts.pop : {}
return nil if scripts.empty?
if (bundle_name = options[:bundle]) && Merb::Assets.bundle? && scripts.size > 1
bundler = Merb::Assets::JavascriptAssetBundler.new(bundle_name, *scripts)
bundled_asset = bundler.bundle!
return js_include_tag(bundled_asset)
end
tags = ""
for script in scripts
attrs = {
:src => asset_path(:javascript, script),
:type => "text/javascript"
}
tags << %Q{<script #{attrs.to_xml_attributes}></script>}
end
return tags
end