diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2005-07-05 01:30:44 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2005-07-05 01:30:44 +0000 |
commit | c6f819edb7844bb518c23b3190b2134b23c2e43c (patch) | |
tree | 2be1eb632160d487664f26240c4024a533b7a987 | |
parent | ac412ef1c7cec4cf58741f48b60368701713d850 (diff) | |
download | rails-c6f819edb7844bb518c23b3190b2134b23c2e43c.tar.gz rails-c6f819edb7844bb518c23b3190b2134b23c2e43c.tar.bz2 rails-c6f819edb7844bb518c23b3190b2134b23c2e43c.zip |
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
-rwxr-xr-x | actionpack/lib/action_controller/base.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index c9b0973561..15430839e7 100755 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -275,6 +275,9 @@ module ActionController #:nodoc: # 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 @@ module ActionController #: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 @@ module ActionController #:nodoc: 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 |