From e1c0aa4d4ca29ca72d61e7d3f5e11af7c8250c03 Mon Sep 17 00:00:00 2001 From: Alvaro Pereyra Date: Sat, 1 Dec 2012 12:49:27 -0500 Subject: Improves documentation on favicon_link_tag --- .../lib/action_view/helpers/asset_tag_helper.rb | 30 ++++++++++++---------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'actionpack/lib/action_view/helpers') diff --git a/actionpack/lib/action_view/helpers/asset_tag_helper.rb b/actionpack/lib/action_view/helpers/asset_tag_helper.rb index 84422ea471..47a4b6cb61 100644 --- a/actionpack/lib/action_view/helpers/asset_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/asset_tag_helper.rb @@ -68,6 +68,9 @@ module ActionView # 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" # # => # @@ -140,27 +143,26 @@ module ActionView ) end - # <%= favicon_link_tag %> - # - # generates - # - # - # - # 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 + # * :rel - Specify the relation of this link, defaults to 'shortcut icon' + # * :type - Override the auto-generated mime type, defaults to 'image/vnd.microsoft.icon' # - # + # ==== Examples # - # The helper accepts an additional options hash where you can override "rel" and "type". + # favicon_link_tag '/myicon.ico' + # # => # - # For example, Mobile Safari looks for a different LINK tag, pointing to an image that + # Mobile Safari looks for a different 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' + # # => + # def favicon_link_tag(source='favicon.ico', options={}) tag('link', { :rel => 'shortcut icon', -- cgit v1.2.3