Skip to content

Instantly share code, notes, and snippets.

@anteaya
Created February 28, 2009 22:46
Show Gist options
  • Save anteaya/72138 to your computer and use it in GitHub Desktop.
Save anteaya/72138 to your computer and use it in GitHub Desktop.
require '../lib/liquid'
class User
attr_accessor :name
liquid_methods :name
def initialize(name)
@name = name
end
end
my_info = User.new('tobi')
arr = IO.readlines("sentence.liquid")
puts Liquid::Template.parse(arr).render('user' => my_info)
*****************************************************
sentence.liquid
sentence = "Hello {{ user.name }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment