Permalink
Browse files

Merge pull request #14129 from joankaradimov/fix-render-to-string

Fix `render_to_string` when called via manually instantiated controllers
  • Loading branch information...
2 parents 9e4c1ab + f6d9b68 commit 53d7b2ffe9ccdf2ded9898e20a947ea7da63566e @carlosantoniodasilva carlosantoniodasilva committed Feb 20, 2014
Showing with 3 additions and 1 deletion.
  1. +3 −1 actionpack/lib/abstract_controller/rendering.rb
@@ -106,7 +106,9 @@ def _process_format(format, options = {})
def _normalize_render(*args, &block)
options = _normalize_args(*args, &block)
#TODO: remove defined? when we restore AP <=> AV dependency
- options[:variant] = request.variant if defined?(request) && request.variant.present?
+ if defined?(request) && request && request.variant.present?
+ options[:variant] = request.variant
+ end
_normalize_options(options)
options
end

0 comments on commit 53d7b2f

Please sign in to comment.