Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
511382bf
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,发现更多精彩内容 >>
提交
511382bf
编写于
10月 15, 2012
作者:
J
Joshua Peek
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
merge! default asset tag options
上级
e6451a55
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
12 deletion
+12
-12
actionpack/lib/action_view/helpers/asset_url_helper.rb
actionpack/lib/action_view/helpers/asset_url_helper.rb
+12
-12
未找到文件。
actionpack/lib/action_view/helpers/asset_url_helper.rb
浏览文件 @
511382bf
...
...
@@ -221,14 +221,14 @@ def compute_asset_host(source = "", options = {})
# 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
def
javascript_path
(
source
,
options
=
{})
path_to_asset
(
source
,
{
type: :javascript
}.
merge
(
options
))
path_to_asset
(
source
,
{
type: :javascript
}.
merge
!
(
options
))
end
alias_method
:path_to_javascript
,
:javascript_path
# aliased to avoid conflicts with a javascript_path named route
# Computes the full URL to a javascript asset in the public javascripts directory.
# This will use +javascript_path+ internally, so most of their behaviors will be the same.
def
javascript_url
(
source
,
options
=
{})
url_to_asset
(
source
,
{
type: :javascript
}.
merge
(
options
))
url_to_asset
(
source
,
{
type: :javascript
}.
merge
!
(
options
))
end
alias_method
:url_to_javascript
,
:javascript_url
# aliased to avoid conflicts with a javascript_url named route
...
...
@@ -243,14 +243,14 @@ def javascript_url(source, options = {})
# 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
def
stylesheet_path
(
source
,
options
=
{})
path_to_asset
(
source
,
{
type: :stylesheet
}.
merge
(
options
))
path_to_asset
(
source
,
{
type: :stylesheet
}.
merge
!
(
options
))
end
alias_method
:path_to_stylesheet
,
:stylesheet_path
# aliased to avoid conflicts with a stylesheet_path named route
# Computes the full URL to a stylesheet asset in the public stylesheets directory.
# This will use +stylesheet_path+ internally, so most of their behaviors will be the same.
def
stylesheet_url
(
source
,
options
=
{})
url_to_asset
(
source
,
{
type: :stylesheet
}.
merge
(
options
))
url_to_asset
(
source
,
{
type: :stylesheet
}.
merge
!
(
options
))
end
alias_method
:url_to_stylesheet
,
:stylesheet_url
# aliased to avoid conflicts with a stylesheet_url named route
...
...
@@ -268,14 +268,14 @@ def stylesheet_url(source, options = {})
# The alias +path_to_image+ is provided to avoid that. Rails uses the alias internally, and
# plugin authors are encouraged to do so.
def
image_path
(
source
,
options
=
{})
path_to_asset
(
source
,
{
type: :image
}.
merge
(
options
))
path_to_asset
(
source
,
{
type: :image
}.
merge
!
(
options
))
end
alias_method
:path_to_image
,
:image_path
# aliased to avoid conflicts with an image_path named route
# Computes the full URL to an image asset.
# This will use +image_path+ internally, so most of their behaviors will be the same.
def
image_url
(
source
,
options
=
{})
url_to_asset
(
source
,
{
type: :image
}.
merge
(
options
))
url_to_asset
(
source
,
{
type: :image
}.
merge
!
(
options
))
end
alias_method
:url_to_image
,
:image_url
# aliased to avoid conflicts with an image_url named route
...
...
@@ -289,14 +289,14 @@ def image_url(source, options = {})
# video_path("/trailers/hd.avi") # => /trailers/hd.avi
# video_path("http://www.example.com/vid/hd.avi") # => http://www.example.com/vid/hd.avi
def
video_path
(
source
,
options
=
{})
path_to_asset
(
source
,
{
type: :video
}.
merge
(
options
))
path_to_asset
(
source
,
{
type: :video
}.
merge
!
(
options
))
end
alias_method
:path_to_video
,
:video_path
# aliased to avoid conflicts with a video_path named route
# Computes the full URL to a video asset in the public videos directory.
# This will use +video_path+ internally, so most of their behaviors will be the same.
def
video_url
(
source
,
options
=
{})
url_to_asset
(
source
,
{
type: :video
}.
merge
(
options
))
url_to_asset
(
source
,
{
type: :video
}.
merge
!
(
options
))
end
alias_method
:url_to_video
,
:video_url
# aliased to avoid conflicts with an video_url named route
...
...
@@ -310,14 +310,14 @@ def video_url(source, options = {})
# audio_path("/sounds/horse.wav") # => /sounds/horse.wav
# audio_path("http://www.example.com/sounds/horse.wav") # => http://www.example.com/sounds/horse.wav
def
audio_path
(
source
,
options
=
{})
path_to_asset
(
source
,
{
type: :audio
}.
merge
(
options
))
path_to_asset
(
source
,
{
type: :audio
}.
merge
!
(
options
))
end
alias_method
:path_to_audio
,
:audio_path
# aliased to avoid conflicts with an audio_path named route
# Computes the full URL to an audio asset in the public audios directory.
# This will use +audio_path+ internally, so most of their behaviors will be the same.
def
audio_url
(
source
,
options
=
{})
url_to_asset
(
source
,
{
type: :audio
}.
merge
(
options
))
url_to_asset
(
source
,
{
type: :audio
}.
merge
!
(
options
))
end
alias_method
:url_to_audio
,
:audio_url
# aliased to avoid conflicts with an audio_url named route
...
...
@@ -330,14 +330,14 @@ def audio_url(source, options = {})
# font_path("/dir/font.ttf") # => /dir/font.ttf
# font_path("http://www.example.com/dir/font.ttf") # => http://www.example.com/dir/font.ttf
def
font_path
(
source
,
options
=
{})
path_to_asset
(
source
,
{
type: :font
}.
merge
(
options
))
path_to_asset
(
source
,
{
type: :font
}.
merge
!
(
options
))
end
alias_method
:path_to_font
,
:font_path
# aliased to avoid conflicts with an font_path named route
# Computes the full URL to a font asset.
# This will use +font_path+ internally, so most of their behaviors will be the same.
def
font_url
(
source
,
options
=
{})
url_to_asset
(
source
,
{
type: :font
}.
merge
(
options
))
url_to_asset
(
source
,
{
type: :font
}.
merge
!
(
options
))
end
alias_method
:url_to_font
,
:font_url
# aliased to avoid conflicts with an font_url named route
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录