Skip to content

Instantly share code, notes, and snippets.

@ka8725
Created April 11, 2014 11:40
Show Gist options
  • Save ka8725/10461034 to your computer and use it in GitHub Desktop.
Save ka8725/10461034 to your computer and use it in GitHub Desktop.
module LiquidPresenters
class Plan < SimpleDelegator
def to_liquid
@to_liquid ||= HashWithIndifferentAccess.new({
id: self.id,
name: self.name,
description: self.description,
status: self.status,
class_id: self.plan_class_id
})
end
end
end
Liquid::Template.parse(template).render({
'plan' => LiquidPresenters::Plan.new(Plan.last)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment