harry
#1
Hi list:
I run the ri’s ERB doc 1st sample
-
require ‘erb’
-
x = 42
-
template = ERB.new <<-EOF
-
The value of x is:
-
EOF
-
puts template.result(binding)
the doc say it will print
“The value of x is: 42”
but my irb print “nil” and there is a
“=> #<ERB:0x2970b24 @src=”_erbout = ‘’; _erbout.concat " The value
of x
is: \n"\n_erbout", @filename=nil, @safe_level=nil>"
at the end of 5th line.
Why?hun…
Thanks
harry
#2
Thanks. It¡¯s work well now:)
I use the RDT’s ri view to lookup api, there’s any other way to look api
and
will not loose information?
harry
#3
ri says:
require ‘erb’
x = 42
template = ERB.new <<-EOF
The value of x is: <%= x %>
EOF
puts template.result(binding)
My wild guess would be that you are using html output of ri command
which doesn’t correctly escape <,> characters.
On 7/25/06, Harry H. [email protected] wrote:
- template = ERB.new <<-EOF
Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails
–
Kent
http://www.datanoise.com
harry
#4
Just use terminal I guess.
$ ri ERB