0
我有以下內容,但是在編輯記錄時它不會顯示當前值。有什麼需要改變提前f.select在Rails 3.1中顯示值
我有以下內容,但是在編輯記錄時它不會顯示當前值。有什麼需要改變提前f.select在Rails 3.1中顯示值
糾正這一
<%= f.select :name, options_for_select([["Select Name", ""], "James", "John", "Richard", "Mike", "Peter"]), :class => 'small-input' %>
由於只需使用: http://apidock.com/rails/v3.2.8/ActionView/Helpers/FormOptionsHelper/select
<%= f.select:
在看看名字, options_for_select([[「James」,「James」],[「John」,「John」]],selected_value),:prompt =>「選擇名稱:」%> 不起作用 – Clay
'= select_tag:name,options_for_select([「James」,「John」,「Richard」,「Mike」,「Peter」,「Mike」)'或'= select_tag:name,options_for_select([[「 ,1],[「John」,2],[「Richard」,3],[「Mike」,4],[「Peter」,5]],[「Mike」,4] – Traz