Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
CGI class question
lars.gersmann
12/31/2005 5:21:00 PM
hi,
when i execute the following
....
cgi.body{
cgi.h1{"huhu"} +
cgi.p{"Wasn los ?"} +
cgi.p{
Dir["*.*"].each{ |f|
"huhu "
}
}
}
....
i never got any "huhu" but
<BODY>
<H1>
huhu
</H1>
<P>
Wasn los ?
</P>
<P>
index.rbtest_dir.rbstyle.css
</P>
</BODY>
what do i wrong ?
thanks for helping me.
many regards,
lars
2 Answers
Stephen Waits
12/31/2005 5:29:00 PM
0
On Dec 31, 2005, at 9:22 AM, lars.gersmann@gmail.com wrote:
> i never got any "huhu" but
>
> <H1>
> huhu
> </H1>
Correct me if I'm wrong, but it looks like it's there. ???
--Steve
james_b
12/31/2005 6:22:00 PM
0
In
cgi.p{
Dir["*.*"].each{ |f|
"huhu "
}
}
cgi.p is emitting the return value of
Dir["*.*"].each{ |f|
"huhu "
}
which is the set of file names, not the string "huhu "
Try this as a simple script to see this:
puts Dir["*.*"].each{ |f| "huhu " }
You may want
Dir["*.*"].each{ |f|
cgi.p{ "huhu " }
}
Or something like that.
James
--
http://www.ru...
- Ruby Help & Documentation
http://www.artima.c...
- Ruby Code & Style: Writers wanted
http://www.rub...
- The Ruby Store for Ruby Stuff
http://www.jame...
- Playing with Better Toys
http://www.30seco...
- Building Better Tools
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
CGI class question
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password