Skip to content

Instantly share code, notes, and snippets.

@girasquid
Created September 25, 2012 04:41
Show Gist options
  • Save girasquid/3780017 to your computer and use it in GitHub Desktop.
Save girasquid/3780017 to your computer and use it in GitHub Desktop.
How to fix unicode errors in Tilt templates
require 'tilt'
template = Tilt.new('views/emails/albums.erb')
template.instance_variable_set(:@default_encoding, 'utf-8')
context = {
:hi => 'hello',
}
html_content = template.render(binding, context)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment