diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index c9b0973561ad334f3ec98a3d27dcc59e96c5491b..15430839e7b28a9a7dd5a5ed6309450608d4b5d8 100755 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -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 template_name, 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