Created
September 25, 2012 04:41
-
-
Save girasquid/3780017 to your computer and use it in GitHub Desktop.
How to fix unicode errors in Tilt templates
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
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