diff options
author | Scott Barron <scott@elitists.net> | 2005-10-15 02:53:21 +0000 |
---|---|---|
committer | Scott Barron <scott@elitists.net> | 2005-10-15 02:53:21 +0000 |
commit | f8f4eccd9afa1ed665980a3c5b1651f25956798a (patch) | |
tree | 1d8cfee79245e147235465c366183c542ff2a64e /actionpack/lib | |
parent | 00a194d73915aa86ff3a95302fe0c367c836e2a0 (diff) | |
download | rails-f8f4eccd9afa1ed665980a3c5b1651f25956798a.tar.gz rails-f8f4eccd9afa1ed665980a3c5b1651f25956798a.tar.bz2 rails-f8f4eccd9afa1ed665980a3c5b1651f25956798a.zip |
If a component redirects when called with render_component_as_string, render the
redirected to action.
Fixes #2327
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2604 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/components.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/components.rb b/actionpack/lib/action_controller/components.rb index 409998525d..312595c21f 100644 --- a/actionpack/lib/action_controller/components.rb +++ b/actionpack/lib/action_controller/components.rb @@ -38,7 +38,14 @@ module ActionController #:nodoc: # Returns the component response as a string def render_component_as_string(options) #:doc: - component_logging(options) { component_response(options, false).body } + component_logging(options) do + response = component_response(options, false) + unless response.redirected_to.nil? + render_component_as_string response.redirected_to + else + response.body + end + end end private |