Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
b4ea6054
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
b4ea6054
编写于
5月 26, 2014
作者:
R
Rafael Mendonça França
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #15340 from aditya-kapoor/correct-docs
Correct Documentation for asset_tag_helpers
上级
cfd9d1d3
c22a253d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
16 addition
and
15 deletion
+16
-15
actionview/lib/action_view/helpers/asset_tag_helper.rb
actionview/lib/action_view/helpers/asset_tag_helper.rb
+16
-15
未找到文件。
actionview/lib/action_view/helpers/asset_tag_helper.rb
浏览文件 @
b4ea6054
...
...
@@ -11,7 +11,7 @@ module Helpers #:nodoc:
# the assets exist before linking to them:
#
# image_tag("rails.png")
# # => <img alt="Rails" src="/
asset
s/rails.png" />
# # => <img alt="Rails" src="/
image
s/rails.png" />
# stylesheet_link_tag("application")
# # => <link href="/assets/application.css?body=1" media="screen" rel="stylesheet" />
module
AssetTagHelper
...
...
@@ -20,7 +20,8 @@ module AssetTagHelper
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, <tt>.js</tt> will be appended automatically.
#
# 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
...
...
@@ -33,19 +34,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="/
asse
ts/xmlhr.js?1284139606"></script>
# # => <script src="/
javascrip
ts/xmlhr.js?1284139606"></script>
#
# javascript_include_tag "template.jst", extname: false
# # => <script src="/
asse
ts/template.jst?1284139606"></script>
# # => <script src="/
javascrip
ts/template.jst?1284139606"></script>
#
# javascript_include_tag "xmlhr.js"
# # => <script src="/
asse
ts/xmlhr.js?1284139606"></script>
# # => <script src="/
javascrip
ts/xmlhr.js?1284139606"></script>
#
# javascript_include_tag "common.javascript", "/elsewhere/cools"
# # => <script src="/
asse
ts/common.javascript?1284139606"></script>
# # => <script src="/
javascrip
ts/common.javascript?1284139606"></script>
# # <script src="/elsewhere/cools.js?1423139606"></script>
#
# javascript_include_tag "http://www.example.com/xmlhr"
...
...
@@ -72,22 +73,22 @@ def javascript_include_tag(*sources)
# apply to all media types.
#
# stylesheet_link_tag "style"
# # => <link href="/
ass
ets/style.css" media="screen" rel="stylesheet" />
# # => <link href="/
styleshe
ets/style.css" media="screen" rel="stylesheet" />
#
# stylesheet_link_tag "style.css"
# # => <link href="/
ass
ets/style.css" media="screen" rel="stylesheet" />
# # => <link href="/
styleshe
ets/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="/
ass
ets/style.css" media="all" rel="stylesheet" />
# # => <link href="/
styleshe
ets/style.css" media="all" rel="stylesheet" />
#
# stylesheet_link_tag "style", media: "print"
# # => <link href="/
ass
ets/style.css" media="print" rel="stylesheet" />
# # => <link href="/
styleshe
ets/style.css" media="print" rel="stylesheet" />
#
# stylesheet_link_tag "random.styles", "/css/stylish"
# # => <link href="/
ass
ets/random.styles" media="screen" rel="stylesheet" />
# # => <link href="/
styleshe
ets/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
...
...
@@ -158,17 +159,17 @@ def auto_discovery_link_tag(type = :rss, url_options = {}, tag_options = {})
# respectively:
#
# favicon_link_tag
# # => <link href="/
asset
s/favicon.ico" rel="shortcut icon" type="image/x-icon" />
# # => <link href="/
image
s/favicon.ico" rel="shortcut icon" type="image/x-icon" />
#
# favicon_link_tag 'myicon.ico'
# # => <link href="/
asset
s/myicon.ico" rel="shortcut icon" type="image/x-icon" />
# # => <link href="/
image
s/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="/
asset
s/mb-icon.png" rel="apple-touch-icon" type="image/png" />
# # => <link href="/
image
s/mb-icon.png" rel="apple-touch-icon" type="image/png" />
def
favicon_link_tag
(
source
=
'favicon.ico'
,
options
=
{})
tag
(
'link'
,
{
:rel
=>
'shortcut icon'
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录