Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
b232c514
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,发现更多精彩内容 >>
提交
b232c514
编写于
12月 24, 2016
作者:
A
Akira Matsuda
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
No need to nodoc private methods
上级
91fa2b71
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
20 addition
and
20 deletion
+20
-20
actionview/lib/action_view/helpers/cache_helper.rb
actionview/lib/action_view/helpers/cache_helper.rb
+4
-4
actionview/lib/action_view/helpers/tags/collection_check_boxes.rb
...ew/lib/action_view/helpers/tags/collection_check_boxes.rb
+1
-1
actionview/lib/action_view/helpers/tags/collection_helpers.rb
...onview/lib/action_view/helpers/tags/collection_helpers.rb
+6
-6
actionview/lib/action_view/helpers/url_helper.rb
actionview/lib/action_view/helpers/url_helper.rb
+1
-1
actionview/lib/action_view/layouts.rb
actionview/lib/action_view/layouts.rb
+1
-1
actionview/lib/action_view/renderer/streaming_template_renderer.rb
...w/lib/action_view/renderer/streaming_template_renderer.rb
+1
-1
actionview/lib/action_view/renderer/template_renderer.rb
actionview/lib/action_view/renderer/template_renderer.rb
+2
-2
actionview/lib/action_view/rendering.rb
actionview/lib/action_view/rendering.rb
+2
-2
actionview/lib/action_view/template/resolver.rb
actionview/lib/action_view/template/resolver.rb
+2
-2
未找到文件。
actionview/lib/action_view/helpers/cache_helper.rb
浏览文件 @
b232c514
...
@@ -215,7 +215,7 @@ def cache_fragment_name(name = {}, skip_digest: nil, virtual_path: nil)
...
@@ -215,7 +215,7 @@ def cache_fragment_name(name = {}, skip_digest: nil, virtual_path: nil)
private
private
def
fragment_name_with_digest
(
name
,
virtual_path
)
#:nodoc:
def
fragment_name_with_digest
(
name
,
virtual_path
)
virtual_path
||=
@virtual_path
virtual_path
||=
@virtual_path
if
virtual_path
if
virtual_path
name
=
controller
.
url_for
(
name
).
split
(
"://"
).
last
if
name
.
is_a?
(
Hash
)
name
=
controller
.
url_for
(
name
).
split
(
"://"
).
last
if
name
.
is_a?
(
Hash
)
...
@@ -226,7 +226,7 @@ def fragment_name_with_digest(name, virtual_path) #:nodoc:
...
@@ -226,7 +226,7 @@ def fragment_name_with_digest(name, virtual_path) #:nodoc:
end
end
end
end
def
fragment_for
(
name
=
{},
options
=
nil
,
&
block
)
#:nodoc:
def
fragment_for
(
name
=
{},
options
=
nil
,
&
block
)
if
content
=
read_fragment_for
(
name
,
options
)
if
content
=
read_fragment_for
(
name
,
options
)
@cache_hit
=
true
@cache_hit
=
true
content
content
...
@@ -236,11 +236,11 @@ def fragment_for(name = {}, options = nil, &block) #:nodoc:
...
@@ -236,11 +236,11 @@ def fragment_for(name = {}, options = nil, &block) #:nodoc:
end
end
end
end
def
read_fragment_for
(
name
,
options
)
#:nodoc:
def
read_fragment_for
(
name
,
options
)
controller
.
read_fragment
(
name
,
options
)
controller
.
read_fragment
(
name
,
options
)
end
end
def
write_fragment_for
(
name
,
options
)
#:nodoc:
def
write_fragment_for
(
name
,
options
)
# VIEW TODO: Make #capture usable outside of ERB
# VIEW TODO: Make #capture usable outside of ERB
# This dance is needed because Builder can't use capture
# This dance is needed because Builder can't use capture
pos
=
output_buffer
.
length
pos
=
output_buffer
.
length
...
...
actionview/lib/action_view/helpers/tags/collection_check_boxes.rb
浏览文件 @
b232c514
...
@@ -24,7 +24,7 @@ def render_component(builder)
...
@@ -24,7 +24,7 @@ def render_component(builder)
builder
.
check_box
+
builder
.
label
builder
.
check_box
+
builder
.
label
end
end
def
hidden_field_name
#:nodoc:
def
hidden_field_name
"
#{
super
}
[]"
"
#{
super
}
[]"
end
end
end
end
...
...
actionview/lib/action_view/helpers/tags/collection_helpers.rb
浏览文件 @
b232c514
...
@@ -43,7 +43,7 @@ def instantiate_builder(builder_class, item, value, text, html_options)
...
@@ -43,7 +43,7 @@ def instantiate_builder(builder_class, item, value, text, html_options)
# Generate default options for collection helpers, such as :checked and
# Generate default options for collection helpers, such as :checked and
# :disabled.
# :disabled.
def
default_html_options_for_collection
(
item
,
value
)
#:nodoc:
def
default_html_options_for_collection
(
item
,
value
)
html_options
=
@html_options
.
dup
html_options
=
@html_options
.
dup
[
:checked
,
:selected
,
:disabled
,
:readonly
].
each
do
|
option
|
[
:checked
,
:selected
,
:disabled
,
:readonly
].
each
do
|
option
|
...
@@ -67,11 +67,11 @@ def default_html_options_for_collection(item, value) #:nodoc:
...
@@ -67,11 +67,11 @@ def default_html_options_for_collection(item, value) #:nodoc:
html_options
html_options
end
end
def
sanitize_attribute_name
(
value
)
#:nodoc:
def
sanitize_attribute_name
(
value
)
"
#{
sanitized_method_name
}
_
#{
sanitized_value
(
value
)
}
"
"
#{
sanitized_method_name
}
_
#{
sanitized_value
(
value
)
}
"
end
end
def
render_collection
#:nodoc:
def
render_collection
@collection
.
map
do
|
item
|
@collection
.
map
do
|
item
|
value
=
value_for_collection
(
item
,
@value_method
)
value
=
value_for_collection
(
item
,
@value_method
)
text
=
value_for_collection
(
item
,
@text_method
)
text
=
value_for_collection
(
item
,
@text_method
)
...
@@ -82,7 +82,7 @@ def render_collection #:nodoc:
...
@@ -82,7 +82,7 @@ def render_collection #:nodoc:
end
.
join
.
html_safe
end
.
join
.
html_safe
end
end
def
render_collection_for
(
builder_class
,
&
block
)
#:nodoc:
def
render_collection_for
(
builder_class
,
&
block
)
options
=
@options
.
stringify_keys
options
=
@options
.
stringify_keys
rendered_collection
=
render_collection
do
|
item
,
value
,
text
,
default_html_options
|
rendered_collection
=
render_collection
do
|
item
,
value
,
text
,
default_html_options
|
builder
=
instantiate_builder
(
builder_class
,
item
,
value
,
text
,
default_html_options
)
builder
=
instantiate_builder
(
builder_class
,
item
,
value
,
text
,
default_html_options
)
...
@@ -103,12 +103,12 @@ def render_collection_for(builder_class, &block) #:nodoc:
...
@@ -103,12 +103,12 @@ def render_collection_for(builder_class, &block) #:nodoc:
end
end
end
end
def
hidden_field
#:nodoc:
def
hidden_field
hidden_name
=
@html_options
[
:name
]
||
hidden_field_name
hidden_name
=
@html_options
[
:name
]
||
hidden_field_name
@template_object
.
hidden_field_tag
(
hidden_name
,
""
,
id:
nil
)
@template_object
.
hidden_field_tag
(
hidden_name
,
""
,
id:
nil
)
end
end
def
hidden_field_name
#:nodoc:
def
hidden_field_name
"
#{
tag_name
(
false
,
@options
[
:index
])
}
"
"
#{
tag_name
(
false
,
@options
[
:index
])
}
"
end
end
end
end
...
...
actionview/lib/action_view/helpers/url_helper.rb
浏览文件 @
b232c514
...
@@ -614,7 +614,7 @@ def method_tag(method)
...
@@ -614,7 +614,7 @@ def method_tag(method)
#
#
# to_form_params({ name: 'Denmark' }, 'country')
# to_form_params({ name: 'Denmark' }, 'country')
# # => [{name: 'country[name]', value: 'Denmark'}]
# # => [{name: 'country[name]', value: 'Denmark'}]
def
to_form_params
(
attribute
,
namespace
=
nil
)
# :nodoc:
def
to_form_params
(
attribute
,
namespace
=
nil
)
attribute
=
if
attribute
.
respond_to?
(
:permitted?
)
attribute
=
if
attribute
.
respond_to?
(
:permitted?
)
unless
attribute
.
permitted?
unless
attribute
.
permitted?
raise
ArgumentError
,
"Attempting to generate a buttom from non-sanitized request parameters!"
\
raise
ArgumentError
,
"Attempting to generate a buttom from non-sanitized request parameters!"
\
...
...
actionview/lib/action_view/layouts.rb
浏览文件 @
b232c514
...
@@ -338,7 +338,7 @@ def _layout(formats)
...
@@ -338,7 +338,7 @@ def _layout(formats)
#
#
# ==== Returns
# ==== Returns
# * <tt>String</tt> - A template name
# * <tt>String</tt> - A template name
def
_implied_layout_name
# :nodoc:
def
_implied_layout_name
controller_path
controller_path
end
end
end
end
...
...
actionview/lib/action_view/renderer/streaming_template_renderer.rb
浏览文件 @
b232c514
...
@@ -29,7 +29,7 @@ def each(&block)
...
@@ -29,7 +29,7 @@ def each(&block)
# This is the same logging logic as in ShowExceptions middleware.
# This is the same logging logic as in ShowExceptions middleware.
# TODO Once "exceptron" is in, refactor this piece to simply re-use exceptron.
# TODO Once "exceptron" is in, refactor this piece to simply re-use exceptron.
def
log_error
(
exception
)
#:nodoc:
def
log_error
(
exception
)
logger
=
ActionView
::
Base
.
logger
logger
=
ActionView
::
Base
.
logger
return
unless
logger
return
unless
logger
...
...
actionview/lib/action_view/renderer/template_renderer.rb
浏览文件 @
b232c514
...
@@ -44,7 +44,7 @@ def determine_template(options)
...
@@ -44,7 +44,7 @@ def determine_template(options)
# Renders the given template. A string representing the layout can be
# Renders the given template. A string representing the layout can be
# supplied as well.
# supplied as well.
def
render_template
(
template
,
layout_name
=
nil
,
locals
=
nil
)
#:nodoc:
def
render_template
(
template
,
layout_name
=
nil
,
locals
=
nil
)
view
,
locals
=
@view
,
locals
||
{}
view
,
locals
=
@view
,
locals
||
{}
render_with_layout
(
layout_name
,
locals
)
do
|
layout
|
render_with_layout
(
layout_name
,
locals
)
do
|
layout
|
...
@@ -54,7 +54,7 @@ def render_template(template, layout_name = nil, locals = nil) #:nodoc:
...
@@ -54,7 +54,7 @@ def render_template(template, layout_name = nil, locals = nil) #:nodoc:
end
end
end
end
def
render_with_layout
(
path
,
locals
)
#:nodoc:
def
render_with_layout
(
path
,
locals
)
layout
=
path
&&
find_layout
(
path
,
locals
.
keys
,
[
formats
.
first
])
layout
=
path
&&
find_layout
(
path
,
locals
.
keys
,
[
formats
.
first
])
content
=
yield
(
layout
)
content
=
yield
(
layout
)
...
...
actionview/lib/action_view/rendering.rb
浏览文件 @
b232c514
...
@@ -91,7 +91,7 @@ def rendered_format
...
@@ -91,7 +91,7 @@ def rendered_format
# Find and render a template based on the options given.
# Find and render a template based on the options given.
# :api: private
# :api: private
def
_render_template
(
options
)
#:nodoc:
def
_render_template
(
options
)
variant
=
options
.
delete
(
:variant
)
variant
=
options
.
delete
(
:variant
)
assigns
=
options
.
delete
(
:assigns
)
assigns
=
options
.
delete
(
:assigns
)
context
=
view_context
context
=
view_context
...
@@ -104,7 +104,7 @@ def _render_template(options) #:nodoc:
...
@@ -104,7 +104,7 @@ def _render_template(options) #:nodoc:
end
end
# Assign the rendered format to look up context.
# Assign the rendered format to look up context.
def
_process_format
(
format
)
#:nodoc:
def
_process_format
(
format
)
super
super
lookup_context
.
formats
=
[
format
.
to_sym
]
lookup_context
.
formats
=
[
format
.
to_sym
]
lookup_context
.
rendered_format
=
lookup_context
.
formats
.
first
lookup_context
.
rendered_format
=
lookup_context
.
formats
.
first
...
...
actionview/lib/action_view/template/resolver.rb
浏览文件 @
b232c514
...
@@ -177,7 +177,7 @@ def build_path(name, prefix, partial)
...
@@ -177,7 +177,7 @@ def build_path(name, prefix, partial)
# always check the cache before hitting the resolver. Otherwise,
# always check the cache before hitting the resolver. Otherwise,
# it always hits the resolver but if the key is present, check if the
# it always hits the resolver but if the key is present, check if the
# resolver is fresher before returning it.
# resolver is fresher before returning it.
def
cached
(
key
,
path_info
,
details
,
locals
)
#:nodoc:
def
cached
(
key
,
path_info
,
details
,
locals
)
name
,
prefix
,
partial
=
path_info
name
,
prefix
,
partial
=
path_info
locals
=
locals
.
map
(
&
:to_s
).
sort!
locals
=
locals
.
map
(
&
:to_s
).
sort!
...
@@ -191,7 +191,7 @@ def cached(key, path_info, details, locals) #:nodoc:
...
@@ -191,7 +191,7 @@ def cached(key, path_info, details, locals) #:nodoc:
end
end
# Ensures all the resolver information is set in the template.
# Ensures all the resolver information is set in the template.
def
decorate
(
templates
,
path_info
,
details
,
locals
)
#:nodoc:
def
decorate
(
templates
,
path_info
,
details
,
locals
)
cached
=
nil
cached
=
nil
templates
.
each
do
|
t
|
templates
.
each
do
|
t
|
t
.
locals
=
locals
t
.
locals
=
locals
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录