Ruby 2.0.0 リファレンスマニュアル > ライブラリ一覧 > cgi/htmlライブラリ > CGI::HtmlExtensionモジュール > popup_menu
popup_menu(name = "", *values) -> String
[permalink][rdoc]scrolling_list(name = "", *values) -> String
select 要素を生成します。
popup_menu("name", ["foo"], ["bar", true], "baz") # <SELECT NAME="name"> # <OPTION VALUE="foo">foo</OPTION> # <OPTION VALUE="bar" SELECTED>bar</OPTION> # <OPTION VALUE="baz">baz</OPTION> # </SELECT> popup_menu("name", ["1", "Foo"], ["2", "Bar", true], "Baz") # <SELECT NAME="name"> # <OPTION VALUE="1">Foo</OPTION> # <OPTION SELECTED VALUE="2">Bar</OPTION> # <OPTION VALUE="Baz">Baz</OPTION> # </SELECT>
popup_menu(attributes) -> String
[permalink][rdoc]scrolling_list(attributes) -> String
select 要素を生成します。
例:
popup_menu({"NAME" => "name", "SIZE" => 2, "MULTIPLE" => true, "VALUES" => [["1", "Foo"], ["2", "Bar", true], "Baz"] }) # <SELECT NAME="name" MULTIPLE SIZE="2"> # <OPTION VALUE="1">Foo</OPTION> # <OPTION SELECTED VALUE="2">Bar</OPTION> # <OPTION VALUE="Baz">Baz</OPTION> # </SELECT>