Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
8534c5bf
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 搜索 >>
提交
8534c5bf
编写于
8月 07, 2009
作者:
Y
Yehuda Katz
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Start cleaning up partial path
上级
9b506484
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
20 addition
and
12 deletion
+20
-12
actionpack/lib/abstract_controller/renderer.rb
actionpack/lib/abstract_controller/renderer.rb
+2
-2
actionpack/lib/action_controller/metal/renderer.rb
actionpack/lib/action_controller/metal/renderer.rb
+1
-1
actionpack/lib/action_view/render/partials.rb
actionpack/lib/action_view/render/partials.rb
+6
-4
actionpack/lib/action_view/render/rendering.rb
actionpack/lib/action_view/render/rendering.rb
+11
-5
未找到文件。
actionpack/lib/abstract_controller/renderer.rb
浏览文件 @
8534c5bf
...
...
@@ -54,7 +54,7 @@ def render(*args)
# :api: plugin
def
render_to_body
(
options
=
{})
# TODO: Refactor so we can just use the normal template logic for this
if
options
[
:_partial_object
]
if
options
.
key?
(
:_partial_object
)
view_context
.
render_partial
(
options
)
else
_determine_template
(
options
)
...
...
@@ -77,7 +77,7 @@ def render_to_string(options = {})
# _layout<ActionView::Template>:: The layout to wrap the template in (optional)
# _partial<TrueClass, FalseClass>:: Whether or not the template to be rendered is a partial
def
_render_template
(
options
)
view_context
.
render_template
(
options
[
:_template
],
options
[
:_layout
],
options
,
options
[
:_partial
]
)
view_context
.
render_template
(
options
)
end
# The list of view paths for this controller. See ActionView::ViewPathSet for
...
...
actionpack/lib/action_controller/metal/renderer.rb
浏览文件 @
8534c5bf
...
...
@@ -57,7 +57,7 @@ def _render_partial(partial, options)
when
true
options
[
:_prefix
]
=
_prefix
when
String
options
[
:_prefix
]
=
_prefix
unless
partial
.
in
dex
(
'/'
)
options
[
:_prefix
]
=
_prefix
unless
partial
.
in
clude?
(
?/
)
options
[
:_template_name
]
=
partial
else
options
[
:_partial_object
]
=
true
...
...
actionpack/lib/action_view/render/partials.rb
浏览文件 @
8534c5bf
...
...
@@ -183,12 +183,12 @@ def _partial_names
end
end
def
render_partial
(
*
arg
s
)
def
render_partial
(
option
s
)
@assigns_added
=
false
_render_partial
(
*
arg
s
)
_render_partial
(
option
s
)
end
def
_render_partial
(
options
=
{}
)
#:nodoc:
def
_render_partial
(
options
)
#:nodoc:
options
[
:locals
]
||=
{}
path
=
partial
=
options
[
:partial
]
...
...
@@ -244,7 +244,9 @@ def _array_like_objects
array_like
end
def
_render_partial_object
(
template
,
options
,
object
=
nil
)
def
_render_partial_object
(
template
,
options
)
object
=
options
[
:object
]
if
options
.
key?
(
:collection
)
_render_partial_collection
(
options
.
delete
(
:collection
),
options
,
template
)
else
...
...
actionpack/lib/action_view/render/rendering.rb
浏览文件 @
8534c5bf
...
...
@@ -123,19 +123,25 @@ def _render_text(text, layout, options)
layout
?
_render_content_with_layout
(
text
,
layout
,
options
[
:locals
])
:
text
end
def
render_template
(
*
args
)
# This is the API to render a ViewContext's template from a controller.
#
# Internal Options:
# _template:: The Template object to render
# _layout:: The layout, if any, to wrap the Template in
# _partial:: true if the template is a partial
def
render_template
(
options
)
@assigns_added
=
nil
_render_template_with_layout
(
*
args
)
template
,
layout
,
partial
=
options
.
values_at
(
:_template
,
:_layout
,
:_partial
)
_render_template_with_layout
(
template
,
layout
,
options
,
partial
)
end
def
_render_template_with_layout
(
template
,
layout
=
nil
,
options
=
{},
partial
=
false
)
def
_render_template_with_layout
(
template
,
layout
=
nil
,
options
=
{},
partial
=
nil
)
logger
&&
logger
.
info
(
"Rendering
#{
template
.
identifier
}#{
' (#{options[:status]})'
if
options
[
:status
]
}
"
)
locals
=
options
[
:locals
]
||
{}
content
=
if
partial
object
=
partial
unless
partial
==
true
_render_partial_object
(
template
,
options
,
object
)
_render_partial_object
(
template
,
options
)
else
_render_template
(
template
,
locals
)
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录