diff options
author | Andrey A.I. Sitnik <andrey@sitnik.ru> | 2012-04-05 15:32:37 +0400 |
---|---|---|
committer | Andrey A.I. Sitnik <andrey@sitnik.ru> | 2012-04-05 15:32:37 +0400 |
commit | f3fb416b89dab8d7b565b174bdc1116a519ab18d (patch) | |
tree | 9b5853dbb424e2b96ce41e870010cda73dd04058 /guides | |
parent | a9398a7da4fa845a0182bd53273c607dae55b1ee (diff) | |
download | rails-f3fb416b89dab8d7b565b174bdc1116a519ab18d.tar.gz rails-f3fb416b89dab8d7b565b174bdc1116a519ab18d.tar.bz2 rails-f3fb416b89dab8d7b565b174bdc1116a519ab18d.zip |
Remove unnecessary in HTML 5 type attribute with default value
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/action_view_overview.textile | 24 | ||||
-rw-r--r-- | guides/source/asset_pipeline.textile | 12 | ||||
-rw-r--r-- | guides/source/layouts_and_rendering.textile | 10 |
3 files changed, 23 insertions, 23 deletions
diff --git a/guides/source/action_view_overview.textile b/guides/source/action_view_overview.textile index 42120e9bad..6649974eea 100644 --- a/guides/source/action_view_overview.textile +++ b/guides/source/action_view_overview.textile @@ -550,9 +550,9 @@ Register one or more JavaScript files to be included when symbol is passed to ja ActionView::Helpers::AssetTagHelper.register_javascript_expansion :monkey => ["head", "body", "tail"] javascript_include_tag :monkey # => - <script type="text/javascript" src="/javascripts/head.js"></script> - <script type="text/javascript" src="/javascripts/body.js"></script> - <script type="text/javascript" src="/javascripts/tail.js"></script> + <script src="/javascripts/head.js"></script> + <script src="/javascripts/body.js"></script> + <script src="/javascripts/tail.js"></script> </ruby> h5. register_stylesheet_expansion @@ -563,9 +563,9 @@ Register one or more stylesheet files to be included when symbol is passed to +s ActionView::Helpers::AssetTagHelper.register_stylesheet_expansion :monkey => ["head", "body", "tail"] stylesheet_link_tag :monkey # => - <link href="/stylesheets/head.css" media="screen" rel="stylesheet" type="text/css" /> - <link href="/stylesheets/body.css" media="screen" rel="stylesheet" type="text/css" /> - <link href="/stylesheets/tail.css" media="screen" rel="stylesheet" type="text/css" /> + <link href="/stylesheets/head.css" media="screen" rel="stylesheet" /> + <link href="/stylesheets/body.css" media="screen" rel="stylesheet" /> + <link href="/stylesheets/tail.css" media="screen" rel="stylesheet" /> </ruby> h5. auto_discovery_link_tag @@ -607,7 +607,7 @@ Returns an html script tag for each of the sources provided. You can pass in the <ruby> javascript_include_tag "common" # => - <script type="text/javascript" src="/javascripts/common.js"></script> + <script src="/javascripts/common.js"></script> </ruby> If the application does not use the asset pipeline, to include the jQuery JavaScript library in your application, pass +:defaults+ as the source. When using +:defaults+, if an +application.js+ file exists in your +public/javascripts+ directory, it will be included as well. @@ -626,7 +626,7 @@ You can also cache multiple JavaScript files into one file, which requires less <ruby> javascript_include_tag :all, :cache => true # => - <script type="text/javascript" src="/javascripts/all.js"></script> + <script src="/javascripts/all.js"></script> </ruby> h5. javascript_path @@ -651,7 +651,7 @@ Returns a stylesheet link tag for the sources specified as arguments. If you don <ruby> stylesheet_link_tag "application" # => - <link href="/stylesheets/application.css" media="screen" rel="stylesheet" type="text/css" /> + <link href="/stylesheets/application.css" media="screen" rel="stylesheet" /> </ruby> You can also include all styles in the stylesheet directory using :all as the source: @@ -664,7 +664,7 @@ You can also cache multiple stylesheets into one file, which requires less HTTP <ruby> stylesheet_link_tag :all, :cache => true - <link href="/stylesheets/all.css" media="screen" rel="stylesheet" type="text/css" /> + <link href="/stylesheets/all.css" media="screen" rel="stylesheet" /> </ruby> h5. stylesheet_path @@ -805,7 +805,7 @@ For example, let's say we have a standard application layout, but also a special <p>This is a special page.</p> <% content_for :special_script do %> - <script type="text/javascript">alert('Hello!')</script> + <script>alert('Hello!')</script> <% end %> </ruby> @@ -1501,7 +1501,7 @@ javascript_tag "alert('All is good')" </ruby> <html> -<script type="text/javascript"> +<script> //<![CDATA[ alert('All is good') //]]> diff --git a/guides/source/asset_pipeline.textile b/guides/source/asset_pipeline.textile index 464788f30f..45f033ac02 100644 --- a/guides/source/asset_pipeline.textile +++ b/guides/source/asset_pipeline.textile @@ -328,9 +328,9 @@ This manifest +app/assets/javascripts/application.js+: would generate this HTML: <html> -<script src="/assets/core.js?body=1" type="text/javascript"></script> -<script src="/assets/projects.js?body=1" type="text/javascript"></script> -<script src="/assets/tickets.js?body=1" type="text/javascript"></script> +<script src="/assets/core.js?body=1"></script> +<script src="/assets/projects.js?body=1"></script> +<script src="/assets/tickets.js?body=1"></script> </html> The +body+ param is required by Sprockets. @@ -346,7 +346,7 @@ config.assets.debug = false When debug mode is off, Sprockets concatenates and runs the necessary preprocessors on all files. With debug mode turned off the manifest above would generate instead: <html> -<script src="/assets/application.js" type="text/javascript"></script> +<script src="/assets/application.js"></script> </html> Assets are compiled and cached on the first request after the server is started. Sprockets sets a +must-revalidate+ Cache-Control HTTP header to reduce request overhead on subsequent requests -- on these the browser gets a 304 (Not Modified) response. @@ -380,8 +380,8 @@ For example this: generates something like this: <html> -<script src="/assets/application-908e25f4bf641868d8683022a5b62f54.js" type="text/javascript"></script> -<link href="/assets/application-4dd5b109ee3439da54f5bdfd78a80473.css" media="screen" rel="stylesheet" type="text/css" /> +<script src="/assets/application-908e25f4bf641868d8683022a5b62f54.js"></script> +<link href="/assets/application-4dd5b109ee3439da54f5bdfd78a80473.css" media="screen" rel="stylesheet" /> </html> The fingerprinting behavior is controlled by the setting of +config.assets.digest+ setting in Rails (which defaults to +true+ for production and +false+ for everything else). diff --git a/guides/source/layouts_and_rendering.textile b/guides/source/layouts_and_rendering.textile index 7c7fc7044c..c2bba56581 100644 --- a/guides/source/layouts_and_rendering.textile +++ b/guides/source/layouts_and_rendering.textile @@ -686,7 +686,7 @@ You can specify a full path relative to the document root, or a URL, if you pref Rails will then output a +script+ tag such as this: <html> -<script src='/assets/main.js' type="text/javascript"></script> +<script src='/assets/main.js'></script> </html> The request to this asset is then served by the Sprockets gem. @@ -718,8 +718,8 @@ If the application does not use the asset pipeline, the +:defaults+ option loads Outputting +script+ tags such as this: <html> -<script src="/javascripts/jquery.js" type="text/javascript"></script> -<script src="/javascripts/jquery_ujs.js" type="text/javascript"></script> +<script src="/javascripts/jquery.js"></script> +<script src="/javascripts/jquery_ujs.js"></script> </html> These two files for jQuery, +jquery.js+ and +jquery_ujs.js+ must be placed inside +public/javascripts+ if the application doesn't use the asset pipeline. These files can be downloaded from the "jquery-rails repository on GitHub":https://github.com/indirect/jquery-rails/tree/master/vendor/assets/javascripts @@ -805,7 +805,7 @@ To include +http://example.com/main.css+: <%= stylesheet_link_tag "http://example.com/main.css" %> </erb> -By default, the +stylesheet_link_tag+ creates links with +media="screen" rel="stylesheet" type="text/css"+. You can override any of these defaults by specifying an appropriate option (+:media+, +:rel+, or +:type+): +By default, the +stylesheet_link_tag+ creates links with +media="screen" rel="stylesheet"+. You can override any of these defaults by specifying an appropriate option (+:media+, +:rel+): <erb> <%= stylesheet_link_tag "main_print", :media => "print" %> @@ -1206,7 +1206,7 @@ Suppose you have the following +ApplicationController+ layout: <head> <title><%= @page_title or 'Page Title' %></title> <%= stylesheet_link_tag 'layout' %> - <style type="text/css"><%= yield :stylesheets %></style> + <style><%= yield :stylesheets %></style> </head> <body> <div id="top_menu">Top menu items here</div> |