Kyle Heon
6/30/2005 11:54:00 PM
Thanks everyone. One more question.
What, if any, is the difference between Erb and eRuby?
Kyle Heon
kheon@comcast.net
-----Original Message-----
From: Jacob Fugal [mailto:lukfugl@gmail.com]
Sent: Thursday, June 30, 2005 11:58 AM
To: ruby-talk ML
Subject: Re: Can you use Erb outside of Apache?
On 6/29/05, Kyle Heon <kheon@comcast.net> wrote:
> Nevermind. I figured it out.
>
> code:
>
> require 'erb'
> @foo = "Hello World!"
> erb = ERB.new("<pre>foo: <%= @foo %></pre>") erb.run
>
> result:
>
> <pre>foo: Hello World!</pre>
>
> If there is a better way, I'm still open.
You can also use eruby on the command line:
$ cat hello.template
<%
def greet( who )
"Hello, #{who}!"
end
%><pre>foo: <%= greet( "world" ) %></pre>
$ eruby hello.template
<pre>foo: Hello, world!</pre>
Jacob Fugal