Skip to content

Instantly share code, notes, and snippets.

@nmenag
Created July 10, 2019 20:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nmenag/2c896f57ad63dd28eccdfc09b88a67d4 to your computer and use it in GitHub Desktop.
Save nmenag/2c896f57ad63dd28eccdfc09b88a67d4 to your computer and use it in GitHub Desktop.
using template with ERB class
template = ERB.new(@template)
template.def_method(LayoutRenderer, 'render')
result = LayoutRenderer.new.render do
ERB.new(@content).result(binding)
end
File.open('tmp/payslip_filename.html', 'w+') do |f|
f.write result
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment