diff options
author | brainopia <brainopia@evilmartians.com> | 2015-01-15 16:52:46 +0300 |
---|---|---|
committer | brainopia <brainopia@evilmartians.com> | 2015-01-22 00:25:50 +0300 |
commit | 685142e4f46292190cedb1d9c69953a948ea92fc (patch) | |
tree | 0fea5dffae9342136940c3da1af1a453950a6563 /actionview/lib/action_view/rendering.rb | |
parent | ee6e13f3da11b21f3966e009b681d05c65f79c9e (diff) | |
download | rails-685142e4f46292190cedb1d9c69953a948ea92fc.tar.gz rails-685142e4f46292190cedb1d9c69953a948ea92fc.tar.bz2 rails-685142e4f46292190cedb1d9c69953a948ea92fc.zip |
Support `:assigns` option when rendering with controllers/mailers.
Diffstat (limited to 'actionview/lib/action_view/rendering.rb')
-rw-r--r-- | actionview/lib/action_view/rendering.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/actionview/lib/action_view/rendering.rb b/actionview/lib/action_view/rendering.rb index abd3b77c67..1e8e7415d1 100644 --- a/actionview/lib/action_view/rendering.rb +++ b/actionview/lib/action_view/rendering.rb @@ -92,12 +92,15 @@ module ActionView # Find and render a template based on the options given. # :api: private def _render_template(options) #:nodoc: - variant = options[:variant] + variant = options.delete(:variant) + assigns = options.delete(:assigns) + context = view_context + context.assign assigns if assigns lookup_context.rendered_format = nil if options[:formats] lookup_context.variants = variant if variant - view_renderer.render(view_context, options) + view_renderer.render(context, options) end # Assign the rendered format to lookup context. |