rails: fields_for select

后端 未结 2 1065
无人及你
无人及你 2021-02-04 12:17

In a view that I have, I am using fields_for to display form data for a relational table. However, part of this form will have select lists to choose from. I see there are lab

2条回答
  •  旧时难觅i
    2021-02-04 12:48

    You are looking for select or collection_select. Both can be used in form_for or fields_for blocks. There are examples on how to use them in a form_for in the documentation

提交回复
热议问题