How can I have a collection_select with 5 options to chose from and when either one is chosen it cannot be picked again for the next (ie if 1 is picked first then only 2,3,4,5 are available to pick from).
我有两个表:invoices 和 Invoice_Line_Items,invoice has_many Invoice_Line_items。Invoice_Line_Items 属于_to Invoice。选项是关系。例如,我不能为同一项目开两次发票。
<%= collection_select( :invoice_line_item, :invoice_line_item_id, @invoice_line_items, :id, :supplier_id, {}, {:multiple => true}) %>
谢谢