diff options
author | Luke Melia <luke@lukemelia.com> | 2008-11-17 22:09:22 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-11-17 22:09:22 -0600 |
commit | 75fb8dfb996f5c5d8b64d10ce7b27eeb681d5316 (patch) | |
tree | 15727c7772ea669c48ce33d1f94a1da0fbc0be57 /actionpack/lib/action_view | |
parent | 3c9beb3dab73013af83b90983f283b76625052b8 (diff) | |
download | rails-75fb8dfb996f5c5d8b64d10ce7b27eeb681d5316.tar.gz rails-75fb8dfb996f5c5d8b64d10ce7b27eeb681d5316.tar.bz2 rails-75fb8dfb996f5c5d8b64d10ce7b27eeb681d5316.zip |
Prevent assert_template failures when a render :inline is called before rendering a file-based template [#1383 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/renderable.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/renderable.rb b/actionpack/lib/action_view/renderable.rb index c23b8cde89..5ff5569db6 100644 --- a/actionpack/lib/action_view/renderable.rb +++ b/actionpack/lib/action_view/renderable.rb @@ -29,7 +29,9 @@ module ActionView stack.push(self) # This is only used for TestResponse to set rendered_template - view.instance_variable_set(:@_first_render, self) unless view.instance_variable_get(:@_first_render) + unless is_a?(InlineTemplate) || view.instance_variable_get(:@_first_render) + view.instance_variable_set(:@_first_render, self) + end view.send(:_evaluate_assigns_and_ivars) view.send(:_set_controller_content_type, mime_type) if respond_to?(:mime_type) |