0
我可以選擇多個名稱,但我無法獲得多個ID到ID字段。有沒有辦法獲得一個字符串或數組的ID?我嘗試在ID字段中添加多個:true和data-delimiter =>',',但這不起作用。謝謝你的幫助。獲得多個ID與rails4自動完成寶石
= simple_form_for :message, url: :messages do |f|
= f.input :master_name, label: "To:", :url => autocomplete_master_name_conversations_path, :as => :autocomplete, id_element: "#master_name_id", input_html: {'data-delimiter' => ',', :multiple => true}
= f.input :recipient_id, as: "string", input_html: {id: "master_name_id", 'data-delimiter' => ',', :multiple => true}
= f.input :body, label: false, as: "text", placeholder: 'Write message...', :input_html => { :rows => 5 }
= f.button :submit, 'Send', :class => "btn btn-lg btn-primary"
之間有什麼區別的收件人:字段?您是否試圖在收件人字段中獲取您正在討論的ID列表? –