From c22a253d1a72602331db1eba3e91bc945eff2346 Mon Sep 17 00:00:00 2001 From: Aditya Kapoor Date: Mon, 26 May 2014 23:14:16 +0530 Subject: Correct Documentation for asset_tag_helpers --- .../lib/action_view/helpers/asset_tag_helper.rb | 31 +++++++++++----------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'actionview') diff --git a/actionview/lib/action_view/helpers/asset_tag_helper.rb b/actionview/lib/action_view/helpers/asset_tag_helper.rb index 824cdaa45e..191af9c897 100644 --- a/actionview/lib/action_view/helpers/asset_tag_helper.rb +++ b/actionview/lib/action_view/helpers/asset_tag_helper.rb @@ -11,7 +11,7 @@ module ActionView # the assets exist before linking to them: # # image_tag("rails.png") - # # => Rails + # # => Rails # stylesheet_link_tag("application") # # => module AssetTagHelper @@ -20,7 +20,8 @@ module ActionView include AssetUrlHelper include TagHelper - # Returns an HTML script tag for each of the +sources+ provided. + # Returns an HTML script tag for each of the +sources+ provided. If + # you don't specify an extension, .js will be appended automatically. # # Sources may be paths to JavaScript files. Relative paths are assumed to be relative # to assets/javascripts, full paths are assumed to be relative to the document @@ -33,19 +34,19 @@ module ActionView # 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" - # # => + # # => # # javascript_include_tag "template.jst", extname: false - # # => + # # => # # javascript_include_tag "xmlhr.js" - # # => + # # => # # javascript_include_tag "common.javascript", "/elsewhere/cools" - # # => + # # => # # # # javascript_include_tag "http://www.example.com/xmlhr" @@ -72,22 +73,22 @@ module ActionView # apply to all media types. # # stylesheet_link_tag "style" - # # => + # # => # # stylesheet_link_tag "style.css" - # # => + # # => # # stylesheet_link_tag "http://www.example.com/style.css" # # => # # stylesheet_link_tag "style", media: "all" - # # => + # # => # # stylesheet_link_tag "style", media: "print" - # # => + # # => # # stylesheet_link_tag "random.styles", "/css/stylish" - # # => + # # => # # def stylesheet_link_tag(*sources) options = sources.extract_options!.stringify_keys @@ -158,17 +159,17 @@ module ActionView # respectively: # # favicon_link_tag - # # => + # # => # # favicon_link_tag 'myicon.ico' - # # => + # # => # # 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' - # # => + # # => def favicon_link_tag(source='favicon.ico', options={}) tag('link', { :rel => 'shortcut icon', -- cgit v1.2.3