File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -102,7 +102,11 @@ def initialize(*); end
102102 # If trying to render a partial or template inside a component,
103103 # pass the render call to the parent view_context.
104104 def render ( options = { } , args = { } , &block )
105- view_context . render ( options , args , &block )
105+ if options . is_a? ( String ) || ( options . is_a? ( Hash ) && options . has_key? ( :partial ) )
106+ view_context . render ( options , args , &block )
107+ else
108+ super
109+ end
106110 end
107111
108112 def controller
@@ -113,7 +117,7 @@ def controller
113117 # Provides a proxy to access helper methods from the context of the current controller
114118 def helpers
115119 raise ViewContextCalledBeforeRenderError , "`helpers` can only be called at render time." if view_context . nil?
116- @helpers ||= view_context
120+ @helpers ||= controller . view_context
117121 end
118122
119123 # Exposes .virutal_path as an instance method
You can’t perform that action at this time.
0 commit comments