Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
cc58fe79
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,发现更多精彩内容 >>
提交
cc58fe79
编写于
4月 02, 2011
作者:
S
Santiago Pastorino
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Implicit actions named not_implemented can be rendered
上级
99da42c2
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
15 addition
and
2 deletion
+15
-2
actionpack/CHANGELOG
actionpack/CHANGELOG
+2
-0
actionpack/lib/abstract_controller/base.rb
actionpack/lib/abstract_controller/base.rb
+2
-0
actionpack/test/controller/new_base/render_implicit_action_test.rb
...k/test/controller/new_base/render_implicit_action_test.rb
+11
-2
未找到文件。
actionpack/CHANGELOG
浏览文件 @
cc58fe79
*
Rails
3.1.0
(
unreleased
)*
*
Implicit
actions
named
not_implemented
can
be
rendered
[
Santiago
Pastorino
]
*
Wildcard
route
will
always
matching
the
optional
format
segment
by
default
.
For
example
if
you
have
this
route
:
map
'*pages'
=>
'pages#show'
...
...
actionpack/lib/abstract_controller/base.rb
浏览文件 @
cc58fe79
require
'erubis'
require
'active_support/configurable'
require
'active_support/descendants_tracker'
require
'active_support/core_ext/module/anonymous'
...
...
@@ -18,6 +19,7 @@ class Base
include
ActiveSupport
::
Configurable
extend
ActiveSupport
::
DescendantsTracker
undef_method
:not_implemented
class
<<
self
attr_reader
:abstract
alias_method
:abstract?
,
:abstract
...
...
actionpack/test/controller/new_base/render_implicit_action_test.rb
浏览文件 @
cc58fe79
...
...
@@ -4,7 +4,8 @@ module RenderImplicitAction
class
SimpleController
<
::
ApplicationController
self
.
view_paths
=
[
ActionView
::
FixtureResolver
.
new
(
"render_implicit_action/simple/hello_world.html.erb"
=>
"Hello world!"
,
"render_implicit_action/simple/hyphen-ated.html.erb"
=>
"Hello hyphen-ated!"
"render_implicit_action/simple/hyphen-ated.html.erb"
=>
"Hello hyphen-ated!"
,
"render_implicit_action/simple/not_implemented.html.erb"
=>
"Not Implemented"
)]
def
hello_world
()
end
...
...
@@ -25,9 +26,17 @@ class RenderImplicitActionTest < Rack::TestCase
assert_status
200
end
test
"render an action called not_implemented"
do
get
"/render_implicit_action/simple/not_implemented"
assert_body
"Not Implemented"
assert_status
200
end
test
"action_method? returns true for implicit actions"
do
assert
SimpleController
.
new
.
action_method?
(
:hello_world
)
assert
SimpleController
.
new
.
action_method?
(
:"hyphen-ated"
)
assert
SimpleController
.
new
.
action_method?
(
:not_implemented
)
end
end
end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录