I want to do something like this:
require 'erb'
@var = 'test'
template = ERB.new File.new("template.erb").read
rendered = template.result(binding())
But how can I use partials in template.erb?
Perhaps brute-force it?
header_partial = ERB.new(File.new("header_partial.erb").read).result(binding)
footer_partial = ERB.new(File.new("footer_partial.erb").read).result(binding)
template = ERB.new <<-EOF
<%= header_partial %>
Body content...
<%= footer_partial %>
EOF
puts template.result(binding)