From 12a75736303d67f17e29f25aa635d521a56d0de2 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 20 Feb 2005 13:50:13 +0000 Subject: Added new keyword to specify load paths as being component based. Added better logging for component calls git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@713 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/components.rb | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'actionpack/lib/action_controller/components.rb') diff --git a/actionpack/lib/action_controller/components.rb b/actionpack/lib/action_controller/components.rb index 148f7b9119..877d8888bd 100644 --- a/actionpack/lib/action_controller/components.rb +++ b/actionpack/lib/action_controller/components.rb @@ -2,13 +2,21 @@ module ActionController #:nodoc: module Components #:nodoc: def self.append_features(base) super - base.helper { def render_component(options) @controller.send(:component_response, options).body end } + base.helper do + def render_component(options) + @controller.logger.info("Start rendering component (#{options.inspect}): ") + @controller.send(:component_response, options).body + @controller.logger.info("\n\nEnd of component rendering") + end + end end protected def render_component(options = {}) #:doc: response = component_response(options) + logger.info "Rendering component (#{options.inspect}): " render_text(response.body, response.headers["Status"]) + logger.info("\n\nEnd of component rendering") end private @@ -22,8 +30,11 @@ module ActionController #:nodoc: def component_request(options) component_request = @request.dup - component_request.send(:instance_variable_set, :@parameters, (options[:params] || {}).merge({ "controller" => options[:controller], "action" => options[:action] })) - component_request + component_request.send( + :instance_variable_set, :@parameters, + (options[:params] || {}).merge({ "controller" => options[:controller], "action" => options[:action] }) + ) + return component_request end end end -- cgit v1.2.3