Nested snippets now update correctly, fixes #84

This commit is contained in:
Mario Visic 2011-06-02 21:56:05 +08:00
parent c07dbb3f98
commit 684b1ddf5c

View File

@ -12,12 +12,15 @@ module Locomotive
@slug = @template_name.gsub('\'', '')
@context[:snippets] = [] if @context[:snippets].nil?
(@context[:snippets] << @slug).uniq!
if @context[:site].present?
snippet = @context[:site].snippets.where(:slug => @slug).first
self.refresh(snippet) if snippet
end
end
def render(context)
return '' if @partial.nil?