Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
0e09875a
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,发现更多精彩内容 >>
提交
0e09875a
编写于
6月 23, 2014
作者:
R
Rafael Mendonça França
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #15732 from kuldeepaggarwal/correct-assets-ouput
[ci skip] correct output for asset_helper methods
上级
679626e4
4db09e6f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
15 addition
and
15 deletion
+15
-15
actionview/lib/action_view/helpers/asset_url_helper.rb
actionview/lib/action_view/helpers/asset_url_helper.rb
+10
-10
actionview/lib/action_view/helpers/form_tag_helper.rb
actionview/lib/action_view/helpers/form_tag_helper.rb
+5
-5
未找到文件。
actionview/lib/action_view/helpers/asset_url_helper.rb
浏览文件 @
0e09875a
...
...
@@ -7,10 +7,10 @@ module Helpers
# urls.
#
# image_path("rails.png")
# # => "/
image
s/rails.png"
# # => "/
asset
s/rails.png"
#
# image_url("rails.png")
# # => "http://www.example.com/
image
s/rails.png"
# # => "http://www.example.com/
asset
s/rails.png"
#
# === Using asset hosts
#
...
...
@@ -155,7 +155,7 @@ def asset_path(source, options = {})
#
# All other options provided are forwarded to +asset_path+ call.
#
# asset_url "application.js" # => http://example.com/application.js
# asset_url "application.js" # => http://example.com/a
ssets/a
pplication.js
# asset_url "application.js", host: "http://cdn.example.com" # => http://cdn.example.com/assets/application.js
#
def
asset_url
(
source
,
options
=
{})
...
...
@@ -236,8 +236,8 @@ def compute_asset_host(source = "", options = {})
# Full paths from the document root will be passed through.
# Used internally by +javascript_include_tag+ to build the script path.
#
# javascript_path "xmlhr" # => /
javascrip
ts/xmlhr.js
# javascript_path "dir/xmlhr.js" # => /
javascrip
ts/dir/xmlhr.js
# javascript_path "xmlhr" # => /
asse
ts/xmlhr.js
# javascript_path "dir/xmlhr.js" # => /
asse
ts/dir/xmlhr.js
# javascript_path "/dir/xmlhr" # => /dir/xmlhr.js
# javascript_path "http://www.example.com/js/xmlhr" # => http://www.example.com/js/xmlhr
# javascript_path "http://www.example.com/js/xmlhr.js" # => http://www.example.com/js/xmlhr.js
...
...
@@ -258,8 +258,8 @@ def javascript_url(source, options = {})
# Full paths from the document root will be passed through.
# Used internally by +stylesheet_link_tag+ to build the stylesheet path.
#
# stylesheet_path "style" # => /
styleshe
ets/style.css
# stylesheet_path "dir/style.css" # => /
styleshe
ets/dir/style.css
# stylesheet_path "style" # => /
ass
ets/style.css
# stylesheet_path "dir/style.css" # => /
ass
ets/dir/style.css
# stylesheet_path "/dir/style.css" # => /dir/style.css
# stylesheet_path "http://www.example.com/css/style" # => http://www.example.com/css/style
# stylesheet_path "http://www.example.com/css/style.css" # => http://www.example.com/css/style.css
...
...
@@ -279,9 +279,9 @@ def stylesheet_url(source, options = {})
# Full paths from the document root will be passed through.
# Used internally by +image_tag+ to build the image path:
#
# image_path("edit") # => "/
image
s/edit"
# image_path("edit.png") # => "/
image
s/edit.png"
# image_path("icons/edit.png") # => "/
image
s/icons/edit.png"
# image_path("edit") # => "/
asset
s/edit"
# image_path("edit.png") # => "/
asset
s/edit.png"
# image_path("icons/edit.png") # => "/
asset
s/icons/edit.png"
# image_path("/icons/edit.png") # => "/icons/edit.png"
# image_path("http://www.example.com/img/edit.png") # => "http://www.example.com/img/edit.png"
#
...
...
actionview/lib/action_view/helpers/form_tag_helper.rb
浏览文件 @
0e09875a
...
...
@@ -508,19 +508,19 @@ def button_tag(content_or_options = nil, options = nil, &block)
#
# ==== Examples
# image_submit_tag("login.png")
# # => <input alt="Login" src="/
image
s/login.png" type="image" />
# # => <input alt="Login" src="/
asset
s/login.png" type="image" />
#
# image_submit_tag("purchase.png", disabled: true)
# # => <input alt="Purchase" disabled="disabled" src="/
image
s/purchase.png" type="image" />
# # => <input alt="Purchase" disabled="disabled" src="/
asset
s/purchase.png" type="image" />
#
# image_submit_tag("search.png", class: 'search_button', alt: 'Find')
# # => <input alt="Find" class="search_button" src="/
image
s/search.png" type="image" />
# # => <input alt="Find" class="search_button" src="/
asset
s/search.png" type="image" />
#
# image_submit_tag("agree.png", disabled: true, class: "agree_disagree_button")
# # => <input alt="Agree" class="agree_disagree_button" disabled="disabled" src="/
image
s/agree.png" type="image" />
# # => <input alt="Agree" class="agree_disagree_button" disabled="disabled" src="/
asset
s/agree.png" type="image" />
#
# image_submit_tag("save.png", data: { confirm: "Are you sure?" })
# # => <input alt="Save" src="/
image
s/save.png" data-confirm="Are you sure?" type="image" />
# # => <input alt="Save" src="/
asset
s/save.png" data-confirm="Are you sure?" type="image" />
def
image_submit_tag
(
source
,
options
=
{})
options
=
options
.
stringify_keys
tag
:input
,
{
"alt"
=>
image_alt
(
source
),
"type"
=>
"image"
,
"src"
=>
path_to_image
(
source
)
}.
update
(
options
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录