Sha256: 663d7e208e060738368be8ef95892e5ba7a57cc9044e2d27be84ec0ae8ec25f9

Contents?: true

Size: 346 Bytes

Versions: 3

Compression:

Stored size: 346 Bytes

Contents

class Snippet < ActiveRecord::Base
  validates_presence_of :name
  validates_uniqueness_of :name

  def render(drops_or_context)
    template = Liquid::Template.parse(body)
    tracker.cleanup template.render(drops_or_context, :registers => {:tracker => tracker})
  end

  def tracker
    @tracker ||= PufferPages::Liquid::Tracker.new
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
puffer_pages-0.0.9 app/models/snippet.rb
puffer_pages-0.0.8 app/models/snippet.rb
puffer_pages-0.0.7 app/models/snippet.rb