lib/nice_partials/partial.rb in nice_partials-0.10.0 vs lib/nice_partials/partial.rb in nice_partials-0.10.1
- old
+ new
@@ -2,14 +2,17 @@
class Partial
autoload :Content, "nice_partials/partial/content"
autoload :Section, "nice_partials/partial/section"
autoload :Stack, "nice_partials/partial/stack"
+ attr_reader :outer_partial
+
attr_reader :local_assigns
alias_method :locals, :local_assigns
def initialize(view_context, local_assigns = nil)
@view_context, @local_assigns = view_context, local_assigns
+ @outer_partial = view_context.partial # Capture the existing outer partial we're rendering within, if any.
end
def yield(*arguments, &block)
if arguments.empty?
@captured_buffer