Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何禁用下拉列表中的默认选项_Html_Ruby On Rails 3 - Fatal编程技术网

Html 如何禁用下拉列表中的默认选项

Html 如何禁用下拉列表中的默认选项,html,ruby-on-rails-3,Html,Ruby On Rails 3,我想禁用下拉列表中给出的默认选项。 e、 g.下拉列表中有三个值 ["Select a status", "Processing", "Completed"] 我想在“选择状态”中应用禁用和选定的属性 你能告诉我怎么做吗?我无法在同一个值上同时使用这两个属性。您是否尝试过使用options\u for\u select <%= select_tag(:city_id, options_for_select(["Free", "Basic", "Advanced", "Super Plat

我想禁用下拉列表中给出的默认选项。 e、 g.下拉列表中有三个值

["Select a status", "Processing", "Completed"]
我想在“选择状态”中应用禁用和选定的属性


你能告诉我怎么做吗?我无法在同一个值上同时使用这两个属性。

您是否尝试过使用
options\u for\u select

<%= select_tag(:city_id, options_for_select(["Free", "Basic", "Advanced", "Super Platinum"], :disabled => "Super Platinum", :selected => "Super Platinum")) %>
“超级白金”,选中=>“超级白金”))%>

以下内容对我很有用

<%= select("post", "person_id", options_for_select(["Free", "Basic", "Advanced", "Super Platinum"], :disabled => "Super Platinum", :selected => "Super Platinum" ))  %>
“超级白金”,选中=>“超级白金”))%>

是的,我尝试过这个,但它没有使“超级白金”成为默认选项。