Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
e9eaae1a
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,发现更多精彩内容 >>
提交
e9eaae1a
编写于
8月 25, 2010
作者:
J
Joost Baaij
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed capitalization
上级
eaeda503
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
8 addition
and
8 deletion
+8
-8
actionpack/lib/abstract_controller/base.rb
actionpack/lib/abstract_controller/base.rb
+8
-8
未找到文件。
actionpack/lib/abstract_controller/base.rb
浏览文件 @
e9eaae1a
...
@@ -6,8 +6,8 @@ module AbstractController
...
@@ -6,8 +6,8 @@ module AbstractController
class
Error
<
StandardError
;
end
class
Error
<
StandardError
;
end
class
ActionNotFound
<
StandardError
;
end
class
ActionNotFound
<
StandardError
;
end
#
AbstractController is a low-level API. Nobody should be using it directly,
#
<tt>AbstractController::Base</tt> is a low-level API. Nobody should be
#
and subclasses of AbstractController
(like ActionController::Base) are
#
using it directly, and subclasses
(like ActionController::Base) are
# expected to provide their own +render+ method, since rendering means
# expected to provide their own +render+ method, since rendering means
# different things depending on the context.
# different things depending on the context.
class
Base
class
Base
...
@@ -40,12 +40,12 @@ def internal_methods
...
@@ -40,12 +40,12 @@ def internal_methods
controller
.
public_instance_methods
(
true
)
controller
.
public_instance_methods
(
true
)
end
end
# The list of hidden actions to an empty
A
rray. Defaults to an
# The list of hidden actions to an empty
a
rray. Defaults to an
# empty
A
rray. This can be modified by other modules or subclasses
# empty
a
rray. This can be modified by other modules or subclasses
# to specify particular actions as hidden.
# to specify particular actions as hidden.
#
#
# ==== Returns
# ==== Returns
# * <tt>
A
rray</tt> - An array of method names that should not be considered actions.
# * <tt>
a
rray</tt> - An array of method names that should not be considered actions.
def
hidden_actions
def
hidden_actions
[]
[]
end
end
...
@@ -57,7 +57,7 @@ def hidden_actions
...
@@ -57,7 +57,7 @@ def hidden_actions
# itself. Finally, #hidden_actions are removed.
# itself. Finally, #hidden_actions are removed.
#
#
# ==== Returns
# ==== Returns
# * <tt>
A
rray</tt> - A list of all methods that should be considered actions.
# * <tt>
a
rray</tt> - A list of all methods that should be considered actions.
def
action_methods
def
action_methods
@action_methods
||=
begin
@action_methods
||=
begin
# All public instance methods of this class, including ancestors
# All public instance methods of this class, including ancestors
...
@@ -86,7 +86,7 @@ def clear_action_methods!
...
@@ -86,7 +86,7 @@ def clear_action_methods!
# controller_name.
# controller_name.
#
#
# ==== Returns
# ==== Returns
# * <tt>
S
tring</tt>
# * <tt>
s
tring</tt>
def
controller_path
def
controller_path
@controller_path
||=
name
.
sub
(
/Controller$/
,
''
).
underscore
unless
anonymous?
@controller_path
||=
name
.
sub
(
/Controller$/
,
''
).
underscore
unless
anonymous?
end
end
...
@@ -185,7 +185,7 @@ def _handle_action_missing
...
@@ -185,7 +185,7 @@ def _handle_action_missing
# * <tt>action_name</tt> - An action name to find a method name for
# * <tt>action_name</tt> - An action name to find a method name for
#
#
# ==== Returns
# ==== Returns
# * <tt>
S
tring</tt> - The name of the method that handles the action
# * <tt>
s
tring</tt> - The name of the method that handles the action
# * <tt>nil</tt> - No method name could be found. Raise ActionNotFound.
# * <tt>nil</tt> - No method name could be found. Raise ActionNotFound.
def
method_for_action
(
action_name
)
def
method_for_action
(
action_name
)
if
action_method?
(
action_name
)
then
action_name
if
action_method?
(
action_name
)
then
action_name
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录