why doesn’t this ERB standalone rendering work for the instance variable? That is the output is blank for the “<%= @test_var %>” line?
@test_var = "test variable"
template = Tilt.new('./app/scripts/email.erb')
st = template.render
puts st
and email.erb
<html>
<body>
<h1>This is it!</h1>
<p>
Phone Number: <%= @test_var %>
</p>
</body>
</html>
gives
<html>
<body>
<h1>This is it!</h1>
<p>
Phone Number:
</p>
</body>
</html>
found the answer…need to have
(a) the following in my class where the instance variables are:
(b) also when calling “run” on the ERB object have to pass the result from this method, e.g.