Skip to content

Commit

Permalink
Revert "Correct Documentation for asset_tag_helpers"
Browse files Browse the repository at this point in the history
This reverts commit c22a253.

Reason: Our documentation assumes the assets are in the proper place and
we are using the default Rails stack.

With the default Rails stack and the assets being in the correct place
the assets helpers uses the `/assets` prefix.
  • Loading branch information
rafaelfranca committed Jun 4, 2014
1 parent e2e308b commit 31737e0
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions actionview/lib/action_view/helpers/asset_tag_helper.rb
Expand Up @@ -11,7 +11,7 @@ module Helpers #:nodoc:
# the assets exist before linking to them:
#
# image_tag("rails.png")
# # => <img alt="Rails" src="/images/rails.png" />
# # => <img alt="Rails" src="/assets/rails.png" />
# stylesheet_link_tag("application")
# # => <link href="/assets/application.css?body=1" media="screen" rel="stylesheet" />
module AssetTagHelper
Expand All @@ -20,8 +20,7 @@ module AssetTagHelper
include AssetUrlHelper
include TagHelper

# Returns an HTML script tag for each of the +sources+ provided. If
# you don't specify an extension, <tt>.js</tt> will be appended automatically.
# Returns an HTML script tag for each of the +sources+ provided.
#
# Sources may be paths to JavaScript files. Relative paths are assumed to be relative
# to <tt>assets/javascripts</tt>, full paths are assumed to be relative to the document
Expand All @@ -34,19 +33,19 @@ module AssetTagHelper
# last argument.
#
# When the Asset Pipeline is enabled, you can pass the name of your manifest as
# source and include other JavaScript or CoffeeScript files inside the manifest.
# source, and include other JavaScript or CoffeeScript files inside the manifest.
#
# javascript_include_tag "xmlhr"
# # => <script src="/javascripts/xmlhr.js?1284139606"></script>
# # => <script src="/assets/xmlhr.js?1284139606"></script>
#
# javascript_include_tag "template.jst", extname: false
# # => <script src="/javascripts/template.jst?1284139606"></script>
# # => <script src="/assets/template.jst?1284139606"></script>
#
# javascript_include_tag "xmlhr.js"
# # => <script src="/javascripts/xmlhr.js?1284139606"></script>
# # => <script src="/assets/xmlhr.js?1284139606"></script>
#
# javascript_include_tag "common.javascript", "/elsewhere/cools"
# # => <script src="/javascripts/common.javascript?1284139606"></script>
# # => <script src="/assets/common.javascript?1284139606"></script>
# # <script src="/elsewhere/cools.js?1423139606"></script>
#
# javascript_include_tag "http://www.example.com/xmlhr"
Expand All @@ -73,22 +72,22 @@ def javascript_include_tag(*sources)
# apply to all media types.
#
# stylesheet_link_tag "style"
# # => <link href="/stylesheets/style.css" media="screen" rel="stylesheet" />
# # => <link href="/assets/style.css" media="screen" rel="stylesheet" />
#
# stylesheet_link_tag "style.css"
# # => <link href="/stylesheets/style.css" media="screen" rel="stylesheet" />
# # => <link href="/assets/style.css" media="screen" rel="stylesheet" />
#
# stylesheet_link_tag "http://www.example.com/style.css"
# # => <link href="http://www.example.com/style.css" media="screen" rel="stylesheet" />
#
# stylesheet_link_tag "style", media: "all"
# # => <link href="/stylesheets/style.css" media="all" rel="stylesheet" />
# # => <link href="/assets/style.css" media="all" rel="stylesheet" />
#
# stylesheet_link_tag "style", media: "print"
# # => <link href="/stylesheets/style.css" media="print" rel="stylesheet" />
# # => <link href="/assets/style.css" media="print" rel="stylesheet" />
#
# stylesheet_link_tag "random.styles", "/css/stylish"
# # => <link href="/stylesheets/random.styles" media="screen" rel="stylesheet" />
# # => <link href="/assets/random.styles" media="screen" rel="stylesheet" />
# # <link href="/css/stylish.css" media="screen" rel="stylesheet" />
def stylesheet_link_tag(*sources)
options = sources.extract_options!.stringify_keys
Expand Down Expand Up @@ -159,17 +158,17 @@ def auto_discovery_link_tag(type = :rss, url_options = {}, tag_options = {})
# respectively:
#
# favicon_link_tag
# # => <link href="/images/favicon.ico" rel="shortcut icon" type="image/x-icon" />
# # => <link href="/assets/favicon.ico" rel="shortcut icon" type="image/x-icon" />
#
# favicon_link_tag 'myicon.ico'
# # => <link href="/images/myicon.ico" rel="shortcut icon" type="image/x-icon" />
# # => <link href="/assets/myicon.ico" rel="shortcut icon" type="image/x-icon" />
#
# Mobile Safari looks for a different link tag, pointing to an image that
# will be used if you add the page to the home screen of an iOS device.
# The following call would generate such a tag:
#
# favicon_link_tag 'mb-icon.png', rel: 'apple-touch-icon', type: 'image/png'
# # => <link href="/images/mb-icon.png" rel="apple-touch-icon" type="image/png" />
# # => <link href="/assets/mb-icon.png" rel="apple-touch-icon" type="image/png" />
def favicon_link_tag(source='favicon.ico', options={})
tag('link', {
:rel => 'shortcut icon',
Expand Down Expand Up @@ -265,7 +264,7 @@ def image_alt(src)
# video_tag("trailer.ogg", controls: true, autobuffer: true)
# # => <video autobuffer="autobuffer" controls="controls" src="/videos/trailer.ogg" ></video>
# video_tag("trailer.m4v", size: "16x10", poster: "screenshot.png")
# # => <video src="/videos/trailer.m4v" width="16" height="10" poster="/images/screenshot.png"></video>
# # => <video src="/videos/trailer.m4v" width="16" height="10" poster="/assets/screenshot.png"></video>
# video_tag("/trailers/hd.avi", size: "16x16")
# # => <video src="/trailers/hd.avi" width="16" height="16"></video>
# video_tag("/trailers/hd.avi", size: "16")
Expand Down

0 comments on commit 31737e0

Please sign in to comment.