1
我有一個問題。這裏是代碼!檢查默認選擇值標籤!
f.select(:departments,Department.all.collect{|c|[c.name,c.id]},{},:size=>10,:multiple => ture)
class Emergency
has many :departments
end
HTML源代碼是這樣的:
<select id="emergency_departments" multiple="multiple" name="emergency[departments][]" size="10"><option value ="">""</option>....</select>
現在我想要得到的默認選擇的標籤,誰可以告訴我怎麼樣?
我想你可能需要一些JavaScript,讓你在找什麼? – 2010-06-07 05:24:54