Rails: Multiple dropdown menus collection_select

前端 未结 2 1421
谎友^
谎友^ 2021-01-26 23:47

Super Rails n00b here: Currently I have a form with the following code:

<%= f.collection_select :account_ids, @accounts, :id, :name, include_blank: true %>         


        
2条回答
  •  情书的邮戳
    2021-01-27 00:25

    If your parameter name ends in "[]", then all inputs with that name will be collated into an array with that name.

    So, your select tag (in html) will be like

    
                            
        
    提交评论

提交回复
热议问题