标签: ruby-on-rails select
我需要在var中保存选定的选项。我怎么能这样做?
<%= f.collection_select(:department_id , Department.all, :id, :name, options ={:prompt => "-Select department"}) %>