提交 c6f819ed 编写于 作者: J Jeremy Kemper

r2827@asus: jeremy | 2005-07-04 21:30:06 -0700

 precompute action_name


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1688 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 ac412ef1
......@@ -275,6 +275,9 @@ class Base
# is generated by taking a snapshot of all the instance variables in the current scope just before a template is rendered.
attr_accessor :assigns
# Returns the name of the action this controller is processing.
attr_accessor :action_name
class << self
# Factory for the standard create, process loop where the controller is discarded after processing.
def process(request, response) #:nodoc:
......@@ -339,6 +342,7 @@ def process(request, response, method = :perform_action, *arguments) #:nodoc:
initialize_template_class(response)
assign_shortcuts(request, response)
initialize_current_url
@action_name = params[:action] || 'index'
log_processing unless logger.nil?
send(method, *arguments)
......@@ -439,11 +443,6 @@ def controller_name
self.class.controller_name
end
# Returns the name of the action this controller is processing.
def action_name
@params["action"] || "index"
end
protected
# Renders the template specified by <tt>template_name</tt>, which defaults to the name of the current controller and action.
# So calling +render+ in WeblogController#show will attempt to render "#{template_root}/weblog/show.rhtml" or
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册