Gavin Kistner
10/13/2004 1:32:00 PM
On Oct 13, 2004, at 7:27 AM, Thomas Counsell wrote:
> Here is a template:
> <html>
> <body>
> <% if welcoming %>
> <h1>Hello <%= name %></h1>
> <% else %>
> <h1>Goodbye <%= name %></h1>
> <% end %>
> </body>
> </html>
>
> And some code:
> require 'erb'
> erb = ERB.new( IO.readlines( "template_file_name").join )
> welcome = true
> name = "Ruby"
> html = erb.result( binding )
Awesome. Thanks!