Solution for nested form

前端 未结 2 1201
清歌不尽
清歌不尽 2021-01-28 09:02

I have been stuck on this problem for a while.

Need to make a form for competitions category with custom inputs. It should take all values fro

2条回答
  •  故里飘歌
    2021-01-28 09:31

    Sounds to me like you're looking for accepts_nested_attributes_for

    See: https://apidock.com/rails/v3.2.3/ActiveRecord/NestedAttributes/ClassMethods/accepts_nested_attributes_for

    https://rubyplus.com/articles/3681-Complex-Forms-in-Rails-5

    Also, check out the cocoon gem.

提交回复
热议问题