app/models/page_part.rb in puffer_pages-0.0.9 vs app/models/page_part.rb in puffer_pages-0.0.10
- old
+ new
@@ -2,13 +2,13 @@
belongs_to :page
validates_presence_of :name
validates_uniqueness_of :name, :scope => :page_id
- def render(drops_or_context, wrap = false)
+ def render(drops_or_context, page = nil)
template = Liquid::Template.parse(body)
- result = tracker.cleanup template.render(drops_or_context, :registers => {:tracker => tracker})
- main? ? result : (wrap ? "<% content_for :#{name} do %>#{result}<% end %>" : result)
+ result = tracker.cleanup template.render(drops_or_context, :registers => {:tracker => tracker, :page => page, :file_system => PufferPages::Liquid::FileSystem.new})
+ main? ? result : "<% content_for :#{name} do %>#{result}<% end %>"
end
def tracker
@tracker ||= PufferPages::Liquid::Tracker.new
end