mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
More component fun
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@748 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
8838020ac4
commit
6cea13a30f
1 changed files with 8 additions and 8 deletions
|
@ -5,9 +5,9 @@ module ActionController #:nodoc:
|
|||
super
|
||||
base.helper do
|
||||
def render_component(options)
|
||||
@controller.logger.info("Start rendering component (#{options.inspect}): ")
|
||||
result = @controller.send(:component_response, options).body
|
||||
@controller.logger.info("\n\nEnd of component rendering")
|
||||
@controller.logger.info("Start rendering component (#{options.inspect}): ") unless @controller.logger.nil?
|
||||
result = @controller.send(:component_response, options, false).body
|
||||
@controller.logger.info("\n\nEnd of component rendering") unless @controller.logger.nil?
|
||||
return result
|
||||
end
|
||||
end
|
||||
|
@ -15,15 +15,15 @@ module ActionController #:nodoc:
|
|||
|
||||
protected
|
||||
def render_component(options = {}) #:doc:
|
||||
response = component_response(options, true)
|
||||
logger.info "Start rendering component (#{options.inspect}): "
|
||||
response = component_response(options)
|
||||
logger.info("Start rendering component (#{options.inspect}): ") unless logger.nil?
|
||||
result = render_text(response.body, response.headers["Status"])
|
||||
logger.info("\n\nEnd of component rendering")
|
||||
logger.info("\n\nEnd of component rendering") unless logger.nil?
|
||||
return result
|
||||
end
|
||||
|
||||
private
|
||||
def component_response(options, reuse_response = false)
|
||||
def component_response(options, reuse_response = true)
|
||||
component_class(options).process(request_for_component(options), reuse_response ? @response : response_for_component)
|
||||
end
|
||||
|
||||
|
@ -41,7 +41,7 @@ module ActionController #:nodoc:
|
|||
end
|
||||
|
||||
def response_for_component
|
||||
Marshal::load(Marshal::dump(@response))
|
||||
@response.dup
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue