On Sat, Sep 6, 2008 at 10:23 PM, Joshua Oransky <[EMAIL PROTECTED]> wrote:
> Ok, so it seems not everything is working with ERB files...
>
> If I do some simple Ruby code, like:
>
> <%
> puts "Hello, World!"
> %>
>
> There is no error, but there is also no output.

AFAIK puts writes to the stdout by default (it's a system call,
nothing specific to erb), which probably goes into nirvana inside the
ruby script engine execution.

> If I put:
>
> <%= "Hello, World!" %>
>
> There IS output.

This is the way to output stuff from erbs.

If you run an erb from the command line, the <%= %> would print your
output, and puts could be used to print warning messages etc. to the
console. So I guess this behaviour is perfectly normal.

Regards,
Alex


-- 
Alexander Klimetschek
[EMAIL PROTECTED]

Reply via email to