diff options
author | Joel Hawksley <joel@hawksley.org> | 2019-05-29 13:03:54 -0600 |
---|---|---|
committer | Joel Hawksley <joel@hawksley.org> | 2019-06-12 16:31:01 -0600 |
commit | c221b5b448569771678279216360460e066095a7 (patch) | |
tree | 6941280b09123cc0eddc1da12454e3d3e07cefea /actionview/lib | |
parent | 60af9db3745f994e8a4bd7afe9dfa6ea8be7bb7c (diff) | |
download | rails-c221b5b448569771678279216360460e066095a7.tar.gz rails-c221b5b448569771678279216360460e066095a7.tar.bz2 rails-c221b5b448569771678279216360460e066095a7.zip |
`RenderingHelper` supports rendering objects that `respond_to?` `:render_in`
Co-authored-by: Natasha Umer <natashau@github.com>
Co-authored-by: Aaron Patterson <tenderlove@github.com>
Co-authored-by: Shawn Allen <shawnbot@github.com>
Co-authored-by: Emily Plummer <emplums@github.com>
Co-authored-by: Diana Mounter <broccolini@github.com>
Co-authored-by: John Hawthorn <jhawthorn@github.com>
Co-authored-by: Nathan Herald <myobie@github.com>
Co-authored-by: Zaid Zawaideh <zawaideh@github.com>
Co-authored-by: Zach Ahn <engineering@zachahn.com>
Diffstat (limited to 'actionview/lib')
-rw-r--r-- | actionview/lib/action_view/helpers/rendering_helper.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/rendering_helper.rb b/actionview/lib/action_view/helpers/rendering_helper.rb index 7ead691113..4be23b68f3 100644 --- a/actionview/lib/action_view/helpers/rendering_helper.rb +++ b/actionview/lib/action_view/helpers/rendering_helper.rb @@ -35,7 +35,11 @@ module ActionView end end else - view_renderer.render_partial(self, partial: options, locals: locals, &block) + if options.respond_to?(:render_in) + options.render_in(self, &block) + else + view_renderer.render_partial(self, partial: options, locals: locals, &block) + end end end |