Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
1cbe9172
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,发现更多精彩内容 >>
提交
1cbe9172
编写于
5月 08, 2011
作者:
D
David Lee
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
There are no snowmen here
上级
94df84a8
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
7 addition
and
7 deletion
+7
-7
actionpack/lib/action_view/helpers/form_tag_helper.rb
actionpack/lib/action_view/helpers/form_tag_helper.rb
+3
-3
actionpack/test/template/form_helper_test.rb
actionpack/test/template/form_helper_test.rb
+2
-2
actionpack/test/template/form_tag_helper_test.rb
actionpack/test/template/form_tag_helper_test.rb
+2
-2
未找到文件。
actionpack/lib/action_view/helpers/form_tag_helper.rb
浏览文件 @
1cbe9172
...
@@ -611,8 +611,8 @@ def html_options_for_form(url_for_options, options, *parameters_for_url)
...
@@ -611,8 +611,8 @@ def html_options_for_form(url_for_options, options, *parameters_for_url)
end
end
def
extra_tags_for_form
(
html_options
)
def
extra_tags_for_form
(
html_options
)
snowman_tag
=
tag
(
:input
,
:type
=>
"hidden"
,
utf8_enforcer
=
tag
(
:input
,
:type
=>
"hidden"
,
:name
=>
"utf8"
,
:value
=>
"✓"
.
html_safe
)
:name
=>
"utf8"
,
:value
=>
"✓"
.
html_safe
)
authenticity_token
=
html_options
.
delete
(
"authenticity_token"
)
authenticity_token
=
html_options
.
delete
(
"authenticity_token"
)
method
=
html_options
.
delete
(
"method"
).
to_s
method
=
html_options
.
delete
(
"method"
).
to_s
...
@@ -629,7 +629,7 @@ def extra_tags_for_form(html_options)
...
@@ -629,7 +629,7 @@ def extra_tags_for_form(html_options)
tag
(
:input
,
:type
=>
"hidden"
,
:name
=>
"_method"
,
:value
=>
method
)
+
token_tag
(
authenticity_token
)
tag
(
:input
,
:type
=>
"hidden"
,
:name
=>
"_method"
,
:value
=>
method
)
+
token_tag
(
authenticity_token
)
end
end
tags
=
snowman_tag
<<
method_tag
tags
=
utf8_enforcer
<<
method_tag
content_tag
(
:div
,
tags
,
:style
=>
'margin:0;padding:0;display:inline'
)
content_tag
(
:div
,
tags
,
:style
=>
'margin:0;padding:0;display:inline'
)
end
end
...
...
actionpack/test/template/form_helper_test.rb
浏览文件 @
1cbe9172
...
@@ -1890,7 +1890,7 @@ def test_form_for_with_labelled_builder
...
@@ -1890,7 +1890,7 @@ def test_form_for_with_labelled_builder
assert_dom_equal
expected
,
output_buffer
assert_dom_equal
expected
,
output_buffer
end
end
def
snowman
(
method
=
nil
)
def
hidden_fields
(
method
=
nil
)
txt
=
%{<div style="margin:0;padding:0;display:inline">}
txt
=
%{<div style="margin:0;padding:0;display:inline">}
txt
<<
%{<input name="utf8" type="hidden" value="✓" />}
txt
<<
%{<input name="utf8" type="hidden" value="✓" />}
if
method
&&
!
method
.
to_s
.
in?
([
'get'
,
'post'
])
if
method
&&
!
method
.
to_s
.
in?
([
'get'
,
'post'
])
...
@@ -1918,7 +1918,7 @@ def whole_form(action = "/", id = nil, html_class = nil, options = nil)
...
@@ -1918,7 +1918,7 @@ def whole_form(action = "/", id = nil, html_class = nil, options = nil)
method
=
options
method
=
options
end
end
form_text
(
action
,
id
,
html_class
,
remote
,
multipart
,
method
)
+
snowman
(
method
)
+
contents
+
"</form>"
form_text
(
action
,
id
,
html_class
,
remote
,
multipart
,
method
)
+
hidden_fields
(
method
)
+
contents
+
"</form>"
end
end
def
test_default_form_builder
def
test_default_form_builder
...
...
actionpack/test/template/form_tag_helper_test.rb
浏览文件 @
1cbe9172
...
@@ -9,7 +9,7 @@ def setup
...
@@ -9,7 +9,7 @@ def setup
@controller
=
BasicController
.
new
@controller
=
BasicController
.
new
end
end
def
snowman
(
options
=
{})
def
hidden_fields
(
options
=
{})
method
=
options
[
:method
]
method
=
options
[
:method
]
txt
=
%{<div style="margin:0;padding:0;display:inline">}
txt
=
%{<div style="margin:0;padding:0;display:inline">}
...
@@ -34,7 +34,7 @@ def form_text(action = "http://www.example.com", options = {})
...
@@ -34,7 +34,7 @@ def form_text(action = "http://www.example.com", options = {})
end
end
def
whole_form
(
action
=
"http://www.example.com"
,
options
=
{})
def
whole_form
(
action
=
"http://www.example.com"
,
options
=
{})
out
=
form_text
(
action
,
options
)
+
snowman
(
options
)
out
=
form_text
(
action
,
options
)
+
hidden_fields
(
options
)
if
block_given?
if
block_given?
out
<<
yield
<<
"</form>"
out
<<
yield
<<
"</form>"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录