从活动管理表的下拉列表中选择多个选项时

时间:2018-07-28 08:58:47

标签: ruby-on-rails ruby

,同时从活动管理表的下拉列表中选择多个选项 多个选定项目未显示在索引文件

form do |f|
    inputs 'Contact Group' do    
        #f.input :contact_id, as: :select, collection: Contact.all, multiple: true
        #f.input :contact_id, as: :select, collection: Contact.select(:name).uniq,multiple: true
        f.input :contact_id, as: :select, :collection => Contact.all.collect {|contact| [contact.name, contact.id] }, multiple: true
        f.input :name
        f.input :disable
    end
    actions
  end

  index do
    id_column
    column :contact_id
    column :name
    column :disable
    actions
  end

0 个答案:

没有答案