2014-02-07 76 views
0

我有自定義select_tagoptions_from_collection_for_select選項的選擇在簡單的形式

= select_tag "[recipient_tokens]", options_from_collection_for_select(User.where(:id => params[:users]), :id, :email, params[:users]), :size => "#{params[:users].size}" 

,但我不能創建此selectsimple form

+0

什麼是你的問題一個值?下面是一個通過簡單形式選擇列表的例子:'= f.association:sport,如::select,collection:Sport.order(:name),提示:「選擇一項運動」,required:true# – steakchaser

+0

@steakchaser問題是:如何創建只有單個值的選擇字段。 – Eugene

回答

0
= f.input "[recipient_tokens]", collection: User.where(:id => params[:users]), label_method: 'email', include_blank: false