--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: Returns an html script tag for each of the <tt>sources</tt> provided. You can pass in the filename (.js extension is optional) of javascript files that exist in your public/javascripts directory for inclusion into the current page or you can pass the full path relative to your document root. To include the Prototype and Scriptaculous javascript libraries in your application, pass <tt>:defaults</tt> as the source. When using <tt>:defaults</tt>, if an application.js file exists in your public javascripts directory, it will be included as well. You can modify the html attributes of the script tag by passing a hash as the last argument.
- !ruby/struct:SM::Flow::H 
  level: 4
  text: Examples
- !ruby/struct:SM::Flow::VERB 
  body: "  javascript_include_tag &quot;xmlhr&quot; # =&gt;\n    &lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/xmlhr.js&quot;&gt;&lt;/script&gt;\n\n  javascript_include_tag &quot;xmlhr.js&quot; # =&gt;\n    &lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/xmlhr.js&quot;&gt;&lt;/script&gt;\n\n  javascript_include_tag &quot;common.javascript&quot;, &quot;/elsewhere/cools&quot; # =&gt;\n    &lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/common.javascript&quot;&gt;&lt;/script&gt;\n    &lt;script type=&quot;text/javascript&quot; src=&quot;/elsewhere/cools.js&quot;&gt;&lt;/script&gt;\n\n  javascript_include_tag &quot;http://www.railsapplication.com/xmlhr&quot; # =&gt;\n    &lt;script type=&quot;text/javascript&quot; src=&quot;http://www.railsapplication.com/xmlhr.js&quot;&gt;&lt;/script&gt;\n\n  javascript_include_tag &quot;http://www.railsapplication.com/xmlhr.js&quot; # =&gt;\n    &lt;script type=&quot;text/javascript&quot; src=&quot;http://www.railsapplication.com/xmlhr.js&quot;&gt;&lt;/script&gt;\n\n  javascript_include_tag :defaults # =&gt;\n    &lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/prototype.js&quot;&gt;&lt;/script&gt;\n    &lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/effects.js&quot;&gt;&lt;/script&gt;\n    ...\n    &lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/application.js&quot;&gt;&lt;/script&gt;\n"
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: = The application.js file is only referenced if it exists
  type: :BULLET
- !ruby/struct:SM::Flow::P 
  body: Though it's not really recommended practice, if you need to extend the default JavaScript set for any reason (e.g., you're going to be using a certain .js file in every action), then take a look at the register_javascript_include_default method.
- !ruby/struct:SM::Flow::P 
  body: "You can also include all javascripts in the javascripts directory using <tt>:all</tt> as the source:"
- !ruby/struct:SM::Flow::VERB 
  body: "  javascript_include_tag :all # =&gt;\n    &lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/prototype.js&quot;&gt;&lt;/script&gt;\n    &lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/effects.js&quot;&gt;&lt;/script&gt;\n    ...\n    &lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/application.js&quot;&gt;&lt;/script&gt;\n    &lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/shop.js&quot;&gt;&lt;/script&gt;\n    &lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/checkout.js&quot;&gt;&lt;/script&gt;\n"
- !ruby/struct:SM::Flow::P 
  body: Note that the default javascript files will be included first. So Prototype and Scriptaculous are available to all subsequently included files.
- !ruby/struct:SM::Flow::H 
  level: 2
  text: Caching multiple javascripts into one
- !ruby/struct:SM::Flow::P 
  body: You can also cache multiple javascripts into one file, which requires less HTTP connections to download and can better be compressed by gzip (leading to faster transfers). Caching will only happen if ActionController::Base.perform_caching is set to <tt>true</tt> (which is the case by default for the Rails production environment, but not for the development environment).
- !ruby/struct:SM::Flow::H 
  level: 4
  text: Examples
- !ruby/struct:SM::Flow::VERB 
  body: "  javascript_include_tag :all, :cache =&gt; true # when ActionController::Base.perform_caching is false =&gt;\n    &lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/prototype.js&quot;&gt;&lt;/script&gt;\n    &lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/effects.js&quot;&gt;&lt;/script&gt;\n    ...\n    &lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/application.js&quot;&gt;&lt;/script&gt;\n    &lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/shop.js&quot;&gt;&lt;/script&gt;\n    &lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/checkout.js&quot;&gt;&lt;/script&gt;\n\n  javascript_include_tag :all, :cache =&gt; true # when ActionController::Base.perform_caching is true =&gt;\n    &lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/all.js&quot;&gt;&lt;/script&gt;\n\n  javascript_include_tag &quot;prototype&quot;, &quot;cart&quot;, &quot;checkout&quot;, :cache =&gt; &quot;shop&quot; # when ActionController::Base.perform_caching is false =&gt;\n    &lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/prototype.js&quot;&gt;&lt;/script&gt;\n    &lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/cart.js&quot;&gt;&lt;/script&gt;\n    &lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/checkout.js&quot;&gt;&lt;/script&gt;\n\n  javascript_include_tag &quot;prototype&quot;, &quot;cart&quot;, &quot;checkout&quot;, :cache =&gt; &quot;shop&quot; # when ActionController::Base.perform_caching is true =&gt;\n    &lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/shop.js&quot;&gt;&lt;/script&gt;\n"
full_name: ActionView::Helpers::AssetTagHelper#javascript_include_tag
is_singleton: false
name: javascript_include_tag
params: (*sources)
visibility: public
