Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improves documentation on favicon_link_tag

  • Loading branch information...
commit e1c0aa4d4ca29ca72d61e7d3f5e11af7c8250c03 1 parent a1ffc4a
Alvaro Pereyra Rabanal alvaropereyra authored
Showing with 16 additions and 14 deletions.
  1. +16 −14 actionpack/lib/action_view/helpers/asset_tag_helper.rb
30 actionpack/lib/action_view/helpers/asset_tag_helper.rb
View
@@ -68,6 +68,9 @@ def javascript_include_tag(*sources)
# to "screen", so you must explicitely set it to "all" for the stylesheet(s) to
# apply to all media types.
#
+ # When the Asset Pipeline is enabled, the helper is usually employed to load the manifest
+ # file to be processed by it.
+ #
# stylesheet_link_tag "style"
# # => <link href="/assets/style.css" media="screen" rel="stylesheet" />
#
@@ -140,27 +143,26 @@ def auto_discovery_link_tag(type = :rss, url_options = {}, tag_options = {})
)
end
- # <%= favicon_link_tag %>
- #
- # generates
- #
- # <link href="/assets/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
- #
- # You may specify a different file in the first argument:
+ # Returns a link loading a favicon file. You may specify a different file
+ # in the first argument. The helper accepts an additional options hash where
+ # you can override "rel" and "type".
#
- # <%= favicon_link_tag '/myicon.ico' %>
- #
- # That's passed to +path_to_image+ as is, so it gives
+ # ==== Options
+ # * <tt>:rel</tt> - Specify the relation of this link, defaults to 'shortcut icon'
+ # * <tt>:type</tt> - Override the auto-generated mime type, defaults to 'image/vnd.microsoft.icon'
#
- # <link href="/myicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
+ # ==== Examples
#
- # The helper accepts an additional options hash where you can override "rel" and "type".
+ # favicon_link_tag '/myicon.ico'
+ # # => <link href="/assets/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
#
- # For example, Mobile Safari looks for a different LINK tag, pointing to an image that
+ # 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 iPod Touch, iPhone, or iPad.
# The following call would generate such a tag:
#
- # <%= favicon_link_tag 'mb-icon.png', rel: 'apple-touch-icon', type: 'image/png' %>
+ # favicon_link_tag '/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',
Please sign in to comment.
Something went wrong with that request. Please try again.