【Ruby】RubyでCGI
■ このスレッドは過去ログ倉庫に格納されています
0344nobodyさん
03/09/09 10:23ID:64dJm4LWtempl = HTML::Template.new('hogehoge.html');
templ.param({'test'=>true});
array = [{'host'=>'book.2ch.net','board'=>'bizplus'},
{'host'=>'news5.2ch.net','board'=>'newsplus'},
{'host'=>'news4.2ch.net','board'=>'news'}];
templ.param({'array'=>array});
print(templ.output);
------------------
----hogehoge.html----
<!begin:test>
<!begin:array>
HOST:<!var:host>
BOARD:<!var:board>
<!end:array>
<!end:test>
---------------------
----error message----
./template.rb:78:in `node': node array not found (ArgumentError)
from ./template.rb:62:in `param'
from ./template.rb:61:in `each'
from ./template.rb:61:in `param'
from ./template.rb:59:in `each'
from ./template.rb:59:in `param'
from ./hogehoge.rb:9
--------------------
■ このスレッドは過去ログ倉庫に格納されています