Created
April 11, 2014 11:40
-
-
Save ka8725/10461034 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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